1

We have a React Native app in which we'd like to track user behaviour (screens visited, certain events). We don't use data for any advertising / the app does not include any ads, etc. It's purely for tracking user behaviour anonymously. We have set:

 <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" tools:replace="android:value" />

I initially set all the 4 flags (below) to false, but it looks like no events come to the Google Analytics dashboard (debug view) at all. The moment I set analytics_storage to true, it's all good, I can see the events in the debug view of the dashboard.

        await firebase.analytics().setAnalyticsCollectionEnabled(true);
     
        await firebase.analytics().setConsent({
          analytics_storage: true,
          ad_storage: false,
          ad_user_data: false,
          ad_personalization: false,
        });

Google explanation for this flag is:

analytics_storage: Enables storage (such as cookies) related to analytics e.g. visit duration.

I'd thought that it'd provide/control sending some additional information, not the basic functionality of sending the events. Am I using something wrong or does this flag need to be set to true in order for any events to be logged to the dashboard?

We're using:

"@react-native-firebase/analytics": "^19.2.2", "@react-native-firebase/app": "^19.2.2",

I've tried to set the flag to false but then it stops logging anything to the debug view in the Google Analytics dashboard.

1 Answer 1

0
  • Google Analytics 4 (GA4) reports upon false flag data. Basically when false is received on GA4 endpoint then the data is processed by internal machine learning models and doing calculations.
  • Regarding debugging false flag, debugView doesn't show unconsented traffic (this is the state, when flags are set to false). On the other hand, consented traffic is the traffic that is being generated from users who have granted your consents settings (when flags are set to true)
  • If you want to debug your implementation of false flags, you should enable BigQuery export in Google Analytics 4 settings. Then you can run SQL query in your Google Cloud Platform project like this and find if your mobile app is sending unconsented hits.

SELECT
  TIMESTAMP_MICROS(event_timestamp) AS event_datetime,
  COALESCE(device.operating_system || " - ", "") || COALESCE(device.operating_system_version, "") AS OS,
  COALESCE(app_info.id || " - ", "") || COALESCE(app_info.version, "") AS APP_INFO,
  COALESCE(device.mobile_brand_name || " - ", "") || COALESCE(device.mobile_model_name, "") AS DEVICE_INFO,
  COALESCE(geo.region || " - ", "") || COALESCE(geo.city, "") AS GEO_INFO,
  user_pseudo_id -- if privacy_info.analytics_storage to false then this column is null, if true then value is reported,
  event_name,
  privacy_info
FROM
  `<replace with your GCP project id>.<replace with your dataset name>.events_intraday_*`
WHERE true
  AND _TABLE_SUFFIX = FORMAT_DATE("%Y%m%d", CURRENT_DATE()) -- today
ORDER BY
  event_datetime DESC

SQL query comment

  • In Google Analytics 4, enable "Streaming" export type.
  • Replace values in FROM part.
  • You can find results in privacy_info columnsfor flags.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.