---
schema_version: "1"
id: 3807a591471bf0637396f72cc529924b7f7484c0b9b59d2b47fdbc503c09f201
title: Lightning Interactions
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform-pkg-exchange/managed_packaging/guides/second-generation/appexchange/app-analytics/app-analytics-read-logs/app-analytics-read-logs-lightning-interactions.md
canonical_url: https://developer.salesforce.com/docs/platform/pkg2-dev/guide/app-analytics-read-logs-lightning-interactions.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 77def4057e34c9c7d288c4f9727f8914fd296de41889ea2a6a95cd8c968cf6e1
products:
  - Second-Generation Managed Packaging Developer Guide
  - merged-docs
---

# Lightning Interactions

Each record in your package usage log that has a `custom_entity_type` of `LightningComponent` or `LightningPage` describes an interaction with your packaged Lightning component or page.

| Required Editions                                                                        |
| ---------------------------------------------------------------------------------------- |
| Available in: both Salesforce Classic and Lightning Experience                           |
| Available in: **Enterprise**, **Performance**, **Unlimited**, and **Developer** Editions |

## Lightning User Interaction

**note:** We’re continually improving the recording of Lightning interaction data in package usage logs. Many interactions with your packaged Lightning component or page are available in AgentExchange App Analytics, but not all. To determine which interactions we capture for your specific package, compare your packaged components to your App Analytics package usage logs.

When a user interacts with your `LightningPage` or `LightningComponent` packaged component, a `log_record_type` of `LightningInteraction` is created. Some standard fields are always populated with data. For example, a Lightning component interaction always has `app_name` and `ui_event_source` data. Lightning interactions have supplemental fields that are often populated. For example, a Lightning interaction sometimes also has `page_app_name` and `page_context` data.

| Standard Data                                                                                                                          | Supplemental Data                                                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| <ul><li>`app_name`</li><li>`ui_event_source`</li><li>`ui_event_type`</li><li>`target_ui_element`</li><li>`parent_ui_element`</li></ul> | <ul><li>`page_app_name`</li><li>`page_context`</li><li>`related_list`</li><li>`page_url`</li></ul> |

## Lightning Page View

When a user views your Lightning page, a `log_record_type` of `LightningPageView` is created. Some standard fields are always populated with data. For example, a Lightning page view always has `app_name` and `page_app_name` data. Lightning page views have supplemental fields that are often populated. For example, a Lightning page view sometimes also has `page_entity_type` and `prevpage_url` data.

| Standard Data                                                                                  | Supplemental Data                                                                  |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| <ul><li>`app_name`</li><li>`page_app_name`</li><li>`page_context`</li><li>`page_url`</li></ul> | <ul><li>`page_entity_type`</li><li>`prevpage_url`</li><li>`related_list`</li></ul> |

## Example

Let’s look at an example package usage log record and analyze the Lightning interaction.

```nolang
{
        "timestamp_derived": "2022-11-22T06:17:39.167Z",
        "log_record_type": "LightningInteraction",
        "request_id": "TID:7635077000004b3035",
        "organization_id": "00Dxx0000006H2l",
        "organization_name": "MyCustomer Inc.",
        "organization_status": "Demo",
        "organization_edition": "Enterprise Edition",
        "organization_country_code": "IN",
        "organization_language_locale": "en_US",
        "organization_time_zone": "Australia/Sydney",
        "organization_instance": "GS0",
        "organization_type": "Production",
        "user_id_token": "005-9BwnBWYO5FMn4cZ1sLw7F3LmTpoe8M77GrZOZHL6xQk=",
        "user_type": "Standard",
        "package_id": "033xx0000004FqD",
        "package_version_id": "04txx0000004Idi",
        "managed_package_namespace": "Acme",
        "custom_entity": "Acme__Insurance_Agents",
        "custom_entity_type": "LightningPage",
        "session_key": "2l4YtFB/RmsRKVsS",
        "login_key": "fGV6RgVOH3ZCgl2v",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/IP_ADDRESS_REMOVED Safari/537.36",
        "user_country_code": "US",
        "user_time_zone": "America/Los_Angeles",
        "app_name": "one:one",
        "page_app_name": "Insurance_App",
        "page_context": "app_flexipage:lwcAppFlexipageWrapper",
        "ui_event_source": "click",
        "ui_event_type": "user",
        "ui_event_sequence_num": "10",
        "target_ui_element": "setup-app-nav-menu-item-link",
        "parent_ui_element": "global-setup",
        "page_url": "/lightning/n/Acme__Insurance_Agents"
    }

```

The `Acme_Insurance_Agents` Lightning page was interacted with as a result of a user action from subscriber org `MyCustomer Inc`. Specifically, a Lightning interaction took place on the page on 2022-11-22 at 6:17 am.

The key data in this analysis are:

| Question | Field                                                                                                                           | Value                                                                                                      |
| -------- | ------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| What     | <ul><li>`custom_entity`</li><li>`custom_entity_type`</li><li>`package_version_id`</li><li>`managed_package_namespace`</li></ul> | <ul><li>`Acme_Insurance_Agents`</li><li>`LightningPage`</li><li>`04txx0000004Idi`</li><li>`Acme`</li></ul> |
| Who      | <ul><li>`organization_id`</li><li>`user_id_token`</li></ul>                                                                     | <ul><li>`00Dxx0000006H2l`</li><li>`005-9BwnBWYO5FMn4cZ1sLw7F3LmTpoe8M77GrZOZHL6xQk=`</li></ul>             |
| How      | `log_record_type`                                                                                                               | `LightningInteraction`                                                                                     |
| When     | `timestamp_derived`                                                                                                             | `2022-11-22T06:17:39.167Z`                                                                                 |

**note:** Lightning interaction data is captured on an event by event basis.

**See Also**

- [Package Usage Logs Schema](https://developer.salesforce.com/docs/platform/pkg2-dev/app-analytics-custom-object-logs.md)
- [Lightning Interaction Event Type](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_eventlogfile_lightninginteraction.htm)
- [Lightning Page View Event Type](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_eventlogfile_lightningpageview.htm)
