Advanced Configuration
Configuration Keys
This section details how to programmatically configure the Content Analytics extension.
The following config settings are available. These settings can also be managed within the Adobe Content Analytics extension.
| Setting | Type | Default | Description |
|---|---|---|---|
configId | String | N/A | Custom datastream for Content Analytics events (overrides edge.configId) |
batchingEnabled | Boolean | true | |
maxBatchSize | Integer | 10 | |
flushInterval | Integer | 2000 | |
trackExperiences | Boolean | true | |
excludedAssetLocationsRegexp | String | - | |
excludedAssetUrlsRegexp | String | - | |
excludedExperienceLocationsRegexp | String | - | |
debugLogging | Boolean | false |
All keys are prepended with contentanalytics..
You can configure the extension through the Data Collection Content Analytics extension UI, or programmatically.
Copied to your clipboardMobileCore.updateConfiguration(mapOf("contentanalytics.maxBatchSize" to 20,"contentanalytics.batchFlushInterval" to 5000))
Copied to your clipboardMobileCore.updateConfigurationWith(configDict: ["contentanalytics.maxBatchSize": 20,"contentanalytics.batchFlushInterval": 5000])
Copied to your clipboardMobileCore.updateConfiguration(mapOf("contentanalytics.maxBatchSize" to 20,"contentanalytics.batchFlushInterval" to 5000))
Copied to your clipboardMobileCore.updateConfigurationWith(configDict: ["contentanalytics.maxBatchSize": 20,"contentanalytics.batchFlushInterval": 5000])
Datastream
You can stream data from content analytics through a separate datastream.
To route Content Analytics to a different datastream:
Copied to your clipboard{"edge.configId": "main-datastream-id","contentanalytics.configId": "content-analytics-datastream-id"}
If contentanalytics.configId is not set, the default edge.configId is used.
Batching
You can use the following flush triggers:
- Batch reaches
maxBatchSize. - Timer reaches
batchFlushInterval(ms). - App backgrounds.
Copied to your clipboard{"contentanalytics.batchingEnabled": true,"contentanalytics.maxBatchSize": 10,"contentanalytics.batchFlushInterval": 2000}
To disable flushes for immediate sends:
Copied to your clipboard{ "contentanalytics.batchingEnabled": false }
Batching only affects network delivery. Features like asset attribution, experience tracking, and featurization work the same whether batching is enabled or disabled.
Filtering
You filter content analytics events through regular expressions.
By URL
An example of a regex that filters out URLs.
Copied to your clipboard{ "contentanalytics.excludedAssetUrlsRegexp": ".*\\.gif$|.*spinner.*" }
By Location
An example of a regex that filers our asset and experience locations.
Copied to your clipboard{ "contentanalytics.excludedAssetLocationsRegexp": "^(debug|test).*" }{ "contentanalytics.excludedExperienceLocationsRegexp": "^admin\\..*" }
Privacy
To manage privacy, use the consent API's.
Edge Consent
Copied to your clipboard// Opt inConsent.update(mapOf("consents" to mapOf("collect" to mapOf("val" to "y"))))// Opt outConsent.update(mapOf("consents" to mapOf("collect" to mapOf("val" to "n"))))// PendingConsent.update(mapOf("consents" to mapOf("collect" to mapOf("val" to "p"))))
Copied to your clipboard// Opt inConsent.update(with: ["consents": ["collect": ["val": "y"]]])// Opt outConsent.update(with: ["consents": ["collect": ["val": "n"]]])// PendingConsent.update(with: ["consents": ["collect": ["val": "p"]]])
Copied to your clipboard// Opt inConsent.update(mapOf("consents" to mapOf("collect" to mapOf("val" to "y"))))// Opt outConsent.update(mapOf("consents" to mapOf("collect" to mapOf("val" to "n"))))// PendingConsent.update(mapOf("consents" to mapOf("collect" to mapOf("val" to "p"))))
Copied to your clipboard// Opt inConsent.update(with: ["consents": ["collect": ["val": "y"]]])// Opt outConsent.update(with: ["consents": ["collect": ["val": "n"]]])// PendingConsent.update(with: ["consents": ["collect": ["val": "p"]]])
| Value | Result |
|---|---|
"y" | Events sent |
"n" | Events dropped |
"p" | Events queued |
Legacy
The legacy privacy APIs also should work.
Copied to your clipboardMobileCore.setPrivacyStatus(MobilePrivacyStatus.OPT_IN) // sendMobileCore.setPrivacyStatus(MobilePrivacyStatus.OPT_OUT) // drop + clearMobileCore.setPrivacyStatus(MobilePrivacyStatus.UNKNOWN) // queue
Copied to your clipboardMobileCore.setPrivacyStatus(.optedIn) // sendMobileCore.setPrivacyStatus(.optedOut) // drop + clearMobileCore.setPrivacyStatus(.unknown) // queue
Copied to your clipboardMobileCore.setPrivacyStatus(MobilePrivacyStatus.OPT_IN) // sendMobileCore.setPrivacyStatus(MobilePrivacyStatus.OPT_OUT) // drop + clearMobileCore.setPrivacyStatus(MobilePrivacyStatus.UNKNOWN) // queue
Copied to your clipboardMobileCore.setPrivacyStatus(.optedIn) // sendMobileCore.setPrivacyStatus(.optedOut) // drop + clearMobileCore.setPrivacyStatus(.unknown) // queue
Data Deletion
To delete data, use resetIdentities() to reset identities, clear cache and queue.
Copied to your clipboardMobileCore.resetIdentities() // clears cache + queue
Copied to your clipboardMobileCore.resetIdentities() // clears cache + queue
Copied to your clipboardMobileCore.resetIdentities() // clears cache + queue
Copied to your clipboardMobileCore.resetIdentities() // clears cache + queue
Featurization
Featurization is configured automatically. Sends experience content to the machine learning service for feature extraction.
See below for an example of the payload to send.
Copied to your clipboard{"experienceId": "mobile-abc123","orgID": "YOUR_ORG@AdobeOrg","content": {"images": [{"value": "https://...jpg", "style": {}}],"texts": [{"value": "Title", "style": {"role": "headline"}}],"ctas": [{"value": "Buy", "style": {"enabled": true}}]}}
Tuning Batch Settings
The default settings (maxBatchSize: 10, batchFlushInterval: 2000 ms) should work well for most apps. Adjust these settings based on your event volume:
| Events per Minute | maxBatchSize | batchFlushInterval (ms) | Notes |
|---|---|---|---|
< 10 | 10 (default) | 2000 (default) | Default works well |
10-50 | 15-25 | 3000 | Reduces network calls |
> 50 | 25-50 | 5000 | High-volume optimization |
Trade-off: Larger batches reduce network overhead but increase latency before data appears in reporting.
Debugging
Use setLogLevel() to set the debugging level.
Copied to your clipboardMobileCore.setLogLevel(LoggingMode.VERBOSE)
Copied to your clipboardMobileCore.setLogLevel(.debug)
Copied to your clipboardMobileCore.setLogLevel(LoggingMode.VERBOSE)
Copied to your clipboardMobileCore.setLogLevel(.debug)
Log entries are tagged. See below for the various tags.
[ContentAnalytics]- main[ContentAnalytics.Batch]- batching[ContentAnalytics.Featurization]- ML service
