We have a hybrid mobile app (implemented using ReactNative) that incorporates a webview of our website for its ecommerce cart. We have Google Analytics tracking (using the same GA property) in both the app and the website, and ecommerce tracking is enabled on the cart website.
The aim is to have ecommerce tracking (from activity in the webview) work for GA sessions that start on the native app.
Is it possible to enable something like Cross Domain tracking between between the app and the website so that a GA session started by the app will be used by the site within the webview?
Use Tag Manager with Google Analytics and Firebase. To get the latest mobile app report features in Google Analytics, use Firebase in your Android and iOS apps. Once enabled in your app, Google Analytics will automatically collect and report on built-in events and user properties.
First, we're introducing a new property type, App + Web, that allows you to combine app and web data for unified reporting and analysis. Reports for this new property use a single set of consistent metrics and dimensions, making it possible to see integrated reporting across app and web like never before.
The latest version of Google Tag Manager for mobile apps is smaller, faster, easier to implement, and more functional. It is integrated with Firebase – Google's platform for mobile developers across iOS and Android – and extends its capabilities for developers and marketers.
This scenario isn't supported by the normal GA auto-linker plugin, but it's should be possible to do this manually by extracting the GA session id (clientId
) from the session started on the app and passing it to the webview (eg via URL parameters), to set it explicitly as described here: https://developers.google.com/analytics/devguides/collection/analyticsjs/cross-domain
Google Tag Manager
Note that if you're using Google Tag Manager in the webview, you can set clientId
as one of the "Fields to Set" in the UA tag configuration.
You'll also need to define a custom Javascript variable to extract clientId
from the URL (or undefined
if it's not present or invalid, which means GA will fall back to it's normal behavior).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With