In-app features
Alongside its tracking capabilities, the SDK embeds some features aimed at Contentsquare users such as Snapshot Capture and SDK Logs.
Enable in-app features
Section titled Enable in-app featuresTo enable in-app features within your app, you have to first make sure your app is launched in the background. To do so, simply start it and press the Android home button. Then, follow the appropriate method described as follows.
On a device: scan the QR code
Section titled On a device: scan the QR codeIf you have access to the Contentsquare platform, you can open the in-app features modal from the menu and scan the QR code with your phone.
On an emulator: use the ADB command
Section titled On an emulator: use the ADB commandIf you are using an emulator, you can use the ADB command to enable in-app features.
If you have access to the Contentsquare platform, you can open the in-app features modal from the menu and select “Copy this ADB command”.
It will look like this:
adb shell am start -W -a android.intent.action.VIEW -d "cs-{{packageName}}://contentsquare.com?activationKey={{uniqueActivationKey}}\&userId={{userId}}"
If you don’t have access to the Contentsquare platform, you can ask the Contentsquare team to share the link with you.
Debugging and Logging
Section titled Debugging and LoggingContentsquare provides Logging capabilities that allow you to see the raw event data logged by your app in Android Studio or in the Contentsquare platform. This is very useful for validation purposes during the instrumentation phase of development and can help you discover errors and mistakes in your analytics implementation and confirm that all events are being logged correctly.
Viewing logs in Android Studio
Section titled Viewing logs in Android StudioBy default, almost all logs are disabled. There is only one log that is always visible to notify that the SDK has started:
I/CSLIB: Contentsquare SDK 4.26.0 starting in app: your.application.package
In order to enable all logs, you simply need to activate in-app features. Logging is directly linked to in-app features state: it starts when in-app features is enabled and stops when you disable in-app features.
To view logs:
- Plug your Android Phone to your Computer (or use emulator)
- Start the Android Studio app
- Filter logs on
CSLIB
Viewing logs in the Contentsquare platform
Section titled Viewing logs in the Contentsquare platformTo view logs directly on the platform, you can use Log visualizer. Log visualizer is a helper tool to see SDK logs without logging tools. It requires having platform access for your project and enabling in-app features. See the SDK Log Visualizer Help Center Article for more information.
Snapshot Capture
Section titled Snapshot CaptureIn order to unlock the full data-visualization capabilities of Contentsquare, the SDK provides a way to capture snapshots of your app screens. These snapshots can only be taken by Contentsquare’s users on their device. They are not captured from your end-users device. It means your Personal Data is safe, as long as you use a test user account.
Snapshots are used in the Zoning Analysis module to look at zone-level metrics (Tap rate, Swipe rate…):
Jetpack Compose support
Section titled Jetpack Compose supportTo enable Jetpack Compose support for Zoning, it is necessary to add a new Gradle dependency to your Gradle build file. Make sure to follow the Track screens section.
In order to use Jetpack Compose for Zoning, the static snapshot must be activated. Make sure to follow the Enable static snapshot section.
Static snapshot
Section titled Static snapshotBy default, when a snapshot is captured, the SDK uses accessible style related view properties to render them later in the Zoning Module. However, sometimes it is not able to render the screen with fidelity. It can be due to different reasons such as using custom properties to handle style (which the SDK cannot access).
To workaround these constraints, you can choose to switch to static snapshot. In this mode, the SDK will capture a bitmap of the visible screen instead of relying on style properties. The trade-off is that you will be required to capture multiple snapshots for screens that can be scrolled (since only the visible part is captured).
Enable static snapshot
Section titled Enable static snapshotTo enable static snapshot, you must have enabled in-app features:
- Long press on the snapshot button to open the Contentsquare settings
- Toggle on the static snapshot option
- Tap on the arrow back to close the Contentsquare settings
- The snapshot button has changed (black background and white camera icon)
Static snapshot is enabled. Simply tap on the button to capture ‘static snapshot’.
Known limitations
Section titled Known limitationsAndroid version
Section titled Android versionThe static snapshot and Jetpack Compose for Zoning are only supported since API 26 (Android Oreo).
Long snapshot
Section titled Long snapshot- The long snapshot for Jetpack Compose is not supported for now.
- The long snapshot for Android API 34+ is not supported for now.
Visual information
Section titled Visual informationThe visual information may not be consistent for snapshots of Jetpack Compose screens. This applies in particular to transparency and visibility.