managed-components/google-analytics-4

Parsing tag settings from gtag/js for Ga4 integration

scamiv opened this issue · 1 comments

scamiv commented

Problem description
Google Analytics 4 (GA4) allows users to define various settings, including ones such as "Define internal traffic", "List unwanted referrals" and "Adjust session timeout" in the GoogleTag settings dialog. These settings are usually evaluated on the client side. They can be accessed using the URL format https://www.googletagmanager.com/gtag/js?id=G-TAGID&cx=c&_slc=1. Currently these settings are not parsed or taken into account.
Not only is this not expected by the user, but some of the resulting issues cannot be worked around in the current implementation. #24

Suggested Solution

  1. Parse and respect tag settings
    To solve this problem, it is necessary to implement a parser that can extract and respect the settings from the above gtag/js URL. These settings play a critical role in fine-tuning the GA4 integration and ensuring accurate tracking and reporting.

  2. Provide equivalents in the settings of the component.
    Although less intuitive, this would also solve the problem.

Thanks! PRs for this functionality are welcome. We can help with review and general assistance in the process 🌱