Search code examples
androidgoogle-analyticsgoogle-analytics-firebase

What is the scope of the utm_campaign dimension in Google Analytics v4 on Android?


I'm using Google Analytics v4 in my Android app and I want to use the Campaign Measurements to see where my users are coming from.

The app is currently under development so it's not available in Google Play, but I'm planning to distribute some preview builds by sending out the apk file directly before I make the first release on Google Play.

I still want to be able to do campaign tracking on these builds so I'm planning to send hard-coded campaign data using setCampaignParamsFromUrl() instead of listening to the INSTALL_REFERRER intent.

The question is, how often do I need to include the campaign data in my hits to Google Analytics? For every hit, once every session, or only once when they change?

For custom dimensions you can specify a scope for your dimensions, but what are the scope for the campaign related dimensions?


Solution

  • You need to include the campaign data only with the first screen view hit. Analytics should associate the campaign with the app instance cid and attribute further data to it.

    INSTALL_REFERRER intent work in a similar way. The campaign data is received from INSTALL_REFERRER intent when app first launches and the campaign params are attached to the next hit.