Adobe Analytics
Configure the Analytics extension in the Data Collection UI
- In the Data Collection UI, select the Extensions tab.
- On the Catalog tab, locate the Adobe Analytics extension, and select Install.
- Type the extension settings. For more information, please read the configure the Analytics Extension section.
- Click Save.
- Follow the publishing process to update SDK configuration.
Configure the Analytics extension
Analytics company
If you have access to more than one Analytics company, a select menu will appear, allowing you to choose which company you want to use. If you only have access to one Analytics company, this select menu will not appear.
Once you select an Analytics company, the list of report suites associated with that company will appear in the report suites section.
Report suites
To learn how to find report suite IDs, please read the documentation on report suites.
Select one or more mobile-enabled report suite identifiers from the combo box to which the Analytics data should be sent. Only report suite identifiers that belong to a company and that are enabled for mobile can be selected. For information on how to enable mobile for your report suite, see the mobile management documentation.
To narrow the search for a report suite identifier, type a string in the combo box text field. After a valid report suite identifier has been selected, this identifier appears in a tag below the combo box. To remove a report suite ID, click on the X next to the ID you want to remove. Report suite IDs can also be configured for the Development and Staging environments.
Tracking server
To learn what a tracking server is and how to find it, please read the documentation on tracking servers.
The tracking server is the tracking domain that all the Analytics requests should be made.
Offline enabled
To learn more about offline tracking, please read the documentation on offline tracking.
When the Offline Enabled checkbox is selected, Analytics hits are queued when your device is offline and are sent later when your device is back online. To use offline tracking, ensure that your report suite is timestamp enabled.
If your report suite is timestamp enabled, the checkbox must be selected. If your report suite is not timestamped enabled, leave the checkbox unselected. If this setting is not configured correctly, data will be lost.
If you are not sure whether your report suite is timestamp enabled, contact Customer Care.
If you currently send Mobile SDK data to a report suite that also collects data from web JavaScript, you may need to set up a separate report suite for mobile data or include a custom timestamp on all JavaScript hits that use the s.timestamp
variable. For more information, please contact Customer Care.
Audience Manager forwarding
For more information about Analytics server-side forwarding to Audience Manager, see the documentation on Analytics sever-side forwarding.
If you set up Analytics server-side forwarding to Audience Manager in your Analytics report suite, select the Audience Manager Forwarding checkbox. When this checkbox is selected, all SDK requests to Analytics servers are sent with an expected response code of 10. This step ensures that client-side Analytics response traffic is forwarded to the Audience Manager SDK so that the User Profile is correctly updated.
Backdate previous session info
Select the Backdate Previous Session Info checkbox only if you have timestamp-enabled report report suites.
When you select this checkbox, the SDK backdates the end-of-session lifecycle information so that this information can be attributed into its correct session. Session information currently consists of crashes and session length.
The SDK also backdates the session information hit to one second after the last hit of the previous session. This means that crashes and session data will correlate with the correct date on which they occurred. One hit is backdated each time a new launch of the application is occurs.
For example, if you select the checkbox, Lifecycle session information or crash events are backdated to one second after the last hit was sent. If you do not select the checkbox, Lifecycle data is attached to the first hit of the subsequent session.
If this option is disabled, Mobile SDK attaches the session information to the current lifecycle.
Batch limit
This setting creates a threshold number of hits to be sent in consecutive calls. For example, if you type or select "10", each Analytics hit before the 10th hit is stored in the queue. When the 10th hit comes in, all 10 hits are sent to Analytics in the order in which they were generated.
If you set a value greater than 0, ensure that the Offline Enabled checkbox is also selected.
The default value for this setting is 0, which means that hit batching is disabled, and all hits are immediately sent to Analytics as they are generated.
Launch hit delay
The number of seconds to wait before Analytics launch hits are sent from the SDK.
Add Analytics to your application
- Add the Mobile Core and Analytics extensions to your project using the app's Gradle file.
Kotlin
Copied to your clipboardimplementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))implementation("com.adobe.marketing.mobile:core")implementation("com.adobe.marketing.mobile:identity")implementation("com.adobe.marketing.mobile:analytics")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:identity'implementation 'com.adobe.marketing.mobile:analytics'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the Analytics extension in your application's main activity.
Java
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Identity;import com.adobe.marketing.mobile.Analytics;
Kotlin
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
- Add the Mobile Core and Analytics extensions to your project using Cocoapods.
- Add the following pods in your
Podfile
:
Copied to your clipboardpod 'AEPCore', '~> 5.0'pod 'AEPAnalytics', '~> 5.0'pod 'AEPIdentity', '~> 5.0'
- Import the Analytics and Identity libraries:
Swift
Copied to your clipboardimport AEPCoreimport AEPAnalyticsimport AEPIdentity
Objective-C
Copied to your clipboard@import AEPCore;@import AEPAnalytics;@import AEPIdentity;
- Add the Mobile Core and Analytics extensions to your project using the app's Gradle file.
Kotlin
Copied to your clipboardimplementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))implementation("com.adobe.marketing.mobile:core")implementation("com.adobe.marketing.mobile:identity")implementation("com.adobe.marketing.mobile:analytics")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:identity'implementation 'com.adobe.marketing.mobile:analytics'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the Analytics extension in your application's main activity.
Java
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Identity;import com.adobe.marketing.mobile.Analytics;
Kotlin
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
- Add the Mobile Core and Analytics extensions to your project using Cocoapods.
- Add the following pods in your
Podfile
:
Copied to your clipboardpod 'AEPCore', '~> 5.0'pod 'AEPAnalytics', '~> 5.0'pod 'AEPIdentity', '~> 5.0'
- Import the Analytics and Identity libraries:
Swift
Copied to your clipboardimport AEPCoreimport AEPAnalyticsimport AEPIdentity
Objective-C
Copied to your clipboard@import AEPCore;@import AEPAnalytics;@import AEPIdentity;
Register Analytics with Mobile Core
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Java
Copied to your clipboardpublic class MainApp extends Application {private final String ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID";@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID);List<Class<? extends Extension>> extensions = Arrays.asList(Analytics.EXTENSION, Identity.EXTENSION);MobileCore.registerExtensions(extensions, o -> {Log.d(LOG_TAG, "AEP Mobile SDK is initialized");});}}
Kotlin
Copied to your clipboardclass MyApp : Application() {val ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID"override fun onCreate() {super.onCreate()MobileCore.setApplication(this)MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID)val extensions = listOf(Analytics.EXTENSION, Identity.EXTENSION)MobileCore.registerExtensions(extensions) {Log.d(LOG_TAG, "AEP Mobile SDK is initialized")}}}
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Swift
In your app's _:didFinishLaunchingWithOptions
function, register the Audience Manager extension with the Mobile Core:
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {MobileCore.registerExtensions([Analytics.self, Identity.self], {MobileCore.configureWith(appId: "yourAppId")})...}
Objective-C
In your app's application:didFinishLaunchingWithOptions
, register Media with Mobile Core:
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[AEPMobileCore registerExtensions:@[AEPMobileAnalytics.class, AEPMobileIdentity.class] completion:^{[AEPMobileCore configureWithAppId: @"yourAppId"];}];...}
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Java
Copied to your clipboardpublic class MainApp extends Application {private final String ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID";@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID);List<Class<? extends Extension>> extensions = Arrays.asList(Analytics.EXTENSION, Identity.EXTENSION);MobileCore.registerExtensions(extensions, o -> {Log.d(LOG_TAG, "AEP Mobile SDK is initialized");});}}
Kotlin
Copied to your clipboardclass MyApp : Application() {val ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID"override fun onCreate() {super.onCreate()MobileCore.setApplication(this)MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID)val extensions = listOf(Analytics.EXTENSION, Identity.EXTENSION)MobileCore.registerExtensions(extensions) {Log.d(LOG_TAG, "AEP Mobile SDK is initialized")}}}
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Swift
In your app's _:didFinishLaunchingWithOptions
function, register the Audience Manager extension with the Mobile Core:
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {MobileCore.registerExtensions([Analytics.self, Identity.self], {MobileCore.configureWith(appId: "yourAppId")})...}
Objective-C
In your app's application:didFinishLaunchingWithOptions
, register Media with Mobile Core:
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[AEPMobileCore registerExtensions:@[AEPMobileAnalytics.class, AEPMobileIdentity.class] completion:^{[AEPMobileCore configureWithAppId: @"yourAppId"];}];...}
Send Lifecycle metrics to Analytics
To automatically report on the application lifecycle details in Analytics, ensure that you properly configure the lifecycle data collection. For more information, see the documentation on Lifecycle metrics.
Send app states and actions to Analytics
To track mobile app states and actions in Adobe Analytics, implement the trackAction and trackState APIs from the Mobile Core extension. For more information, see the track app actions and track app states tutorials.
trackState reports the view state as the Page Name, and state views are reported as Page View in Analytics. The value is sent to Analytics by using the page name variable (pagename=value
).
trackAction reports the Action as an event and does not increment your page views in Analytics. The value is sent to Analytics by using the action variable (action=value
).
Integrations with Adobe Experience Platform solutions and services
Analytics for Adobe Target (A4T)
To see the performance of your Target activities for some segments, you can set up the Analytics extension for Target (A4T) cross-solution integration by enabling the A4T campaigns. This integration allows you to use Analytics reports to examine your results. If you use Analytics as the reporting source for an activity, all reporting and segmentation for that activity is based on Analytics data collection. For more information, see Target.
Server-side forwarding with Audience Manager
To enable server-side forwarding to share Analytics data with Audience Manager, see the documentation on Server-side Forwarding to enable server-side forwarding at the report suite level.
To enable client-side forwarding to share Analytics data with Audience Manager within the SDK, in the Data Collection UI, select the Audience Manager Forwarding checkbox. For more information, go to Audience Manager.
Audio and video analytics
For more information about collecting audio and video analytics, please read the documentation on Media Analytics for audio and video.
Event serialization
Event serialization is not supported by processing rules. To set serialized events directly on the hits sent to Analytics, use the following syntax in context data parameters:
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Java
Syntax
Copied to your clipboardcdata.put("&&events", "event1:12341234");
Example
Copied to your clipboard//create a context data dictionaryHashMap cdata = new HashMap<String, Object>();// add eventscdata.put("&&events", "event1:12341234");// send a tracking call - use either a trackAction or TrackState call.// trackAction example:MobileCore.trackAction("Action Name", cdata);// trackState example:MobileCore.trackState("State Name", cdata);
Kotlin
Example
Copied to your clipboard//create a context data dictionaryval cdata: Map<String, Any?> = mapOf("&&events" to "event1:12341234")// send a tracking call - use either a trackAction or TrackState call.// trackAction example:MobileCore.trackAction("Action Name", cdata);// trackState example:MobileCore.trackState("State Name", cdata);
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Swift
Syntax
Copied to your clipboardcontextdata["&&events"] = "event1:12341234"
Example
Copied to your clipboard//create a context data dictionaryvar contextData = [String: Any]()// add eventscontextData["&&events"] = "event1:12341234"// send the tracking call - use either a trackAction or trackState call.// trackAction example:MobileCore.track(action: "Action Name" as String, data: contextData)// trackState example:MobileCore.track(state: "State Name" as String, data: contextData)
Objective-C
Syntax
Copied to your clipboard[contextData setObject:@"eventN:serial number" forKey:@"&&events"];
Example
Copied to your clipboard//create a context data dictionaryNSMutableDictionary *contextData = [NSMutableDictionary dictionary];// add events[contextData setObject:@"event1:12341234" forKey:@"&&events"];// send the tracking call - use either a trackAction or trackState call.// trackAction example:[AEPMobileCore trackAction:@"Action Name" data:contextData];// trackState example:[AEPMobileCore trackState:@"State Name" data:contextData];
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Java
Syntax
Copied to your clipboardcdata.put("&&events", "event1:12341234");
Example
Copied to your clipboard//create a context data dictionaryHashMap cdata = new HashMap<String, Object>();// add eventscdata.put("&&events", "event1:12341234");// send a tracking call - use either a trackAction or TrackState call.// trackAction example:MobileCore.trackAction("Action Name", cdata);// trackState example:MobileCore.trackState("State Name", cdata);
Kotlin
Example
Copied to your clipboard//create a context data dictionaryval cdata: Map<String, Any?> = mapOf("&&events" to "event1:12341234")// send a tracking call - use either a trackAction or TrackState call.// trackAction example:MobileCore.trackAction("Action Name", cdata);// trackState example:MobileCore.trackState("State Name", cdata);
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Swift
Syntax
Copied to your clipboardcontextdata["&&events"] = "event1:12341234"
Example
Copied to your clipboard//create a context data dictionaryvar contextData = [String: Any]()// add eventscontextData["&&events"] = "event1:12341234"// send the tracking call - use either a trackAction or trackState call.// trackAction example:MobileCore.track(action: "Action Name" as String, data: contextData)// trackState example:MobileCore.track(state: "State Name" as String, data: contextData)
Objective-C
Syntax
Copied to your clipboard[contextData setObject:@"eventN:serial number" forKey:@"&&events"];
Example
Copied to your clipboard//create a context data dictionaryNSMutableDictionary *contextData = [NSMutableDictionary dictionary];// add events[contextData setObject:@"event1:12341234" forKey:@"&&events"];// send the tracking call - use either a trackAction or trackState call.// trackAction example:[AEPMobileCore trackAction:@"Action Name" data:contextData];// trackState example:[AEPMobileCore trackState:@"State Name" data:contextData];
Configuration keys
To update the SDK configuration programmatically, use the following information to change your Analytics configuration values.
Key | Required | Description | Data Type |
---|---|---|---|
analytics.server | Yes | See Tracking Server | String |
analytics.rsids | Yes | See Report Suites. Multiple report suite IDs can be comma separated with no space in- between. For example: "rsids" : "rsid" "rsids" : "rsid1,rsid2" | String |
analytics.batchLimit | No | See Batch Limit | Integer |
analytics.aamForwardingEnabled | No | Boolean | |
analytics.offlineEnabled | No | See Offline Enabled | Boolean |
analytics.backdatePreviousSessionInfo | No | Boolean |
Update Analytics configuration
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Java
Example
Copied to your clipboardHashMap<String, Object> data = new HashMap<String, Object>();data.put("analytics.server", "sample.analytics.tracking.server");data.put("analytics.rsids", "rsid1,rsid2");data.put("analytics.batchLimit", 10);data.put("analytics.offlineEnabled", true);MobileCore.updateConfiguration(data);
Kotlin
Example
Copied to your clipboardval data: Map<String, Any?> = mapOf("analytics.server" to "sample.analytics.tracking.server","analytics.rsids" to "rsid1,rsid2","analytics.batchLimit" to 10,"analytics.offlineEnabled" to true)MobileCore.updateConfiguration(data)
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Swift
Example
Copied to your clipboardlet updatedConfig = ["analytics.server":"sample.analytics.tracking.server","analytics.rsids":"rsid1,rsid2","analytics.batchLimit":10,"analytics.offlineEnabled":true] as [String: Any]MobileCore.updateConfigurationWith(configDict: updatedConfig)
Objective-C
Example
Copied to your clipboardNSDictionary *updatedConfig = @{@"analytics.server":@"sample.analytics.tracking.server",@"analytics.rsids":@"rsid1,rsid2",@"analytics.batchLimit":@(10),@"analytics.offlineEnabled":@YES};[AEPMobileCore updateConfiguration:updatedConfig];
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Java
Example
Copied to your clipboardHashMap<String, Object> data = new HashMap<String, Object>();data.put("analytics.server", "sample.analytics.tracking.server");data.put("analytics.rsids", "rsid1,rsid2");data.put("analytics.batchLimit", 10);data.put("analytics.offlineEnabled", true);MobileCore.updateConfiguration(data);
Kotlin
Example
Copied to your clipboardval data: Map<String, Any?> = mapOf("analytics.server" to "sample.analytics.tracking.server","analytics.rsids" to "rsid1,rsid2","analytics.batchLimit" to 10,"analytics.offlineEnabled" to true)MobileCore.updateConfiguration(data)
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Identityimport com.adobe.marketing.mobile.Analytics
Swift
Example
Copied to your clipboardlet updatedConfig = ["analytics.server":"sample.analytics.tracking.server","analytics.rsids":"rsid1,rsid2","analytics.batchLimit":10,"analytics.offlineEnabled":true] as [String: Any]MobileCore.updateConfigurationWith(configDict: updatedConfig)
Objective-C
Example
Copied to your clipboardNSDictionary *updatedConfig = @{@"analytics.server":@"sample.analytics.tracking.server",@"analytics.rsids":@"rsid1,rsid2",@"analytics.batchLimit":@(10),@"analytics.offlineEnabled":@YES};[AEPMobileCore updateConfiguration:updatedConfig];
For more information, see the configuration API reference.