managed-components/google-analytics-4

Allow setting query parameters without prefix in tool settings

Opened this issue · 2 comments

scamiv commented

Problem Description
Currently there is a limitation in the ability to set query parameters without a prefix at the component / event level using the tool settings menu. The only option available is to set definitions that are automatically prefixed with an epn. or ep. prefix. This limitation makes it impossible to set important query parameters such as "Ignore Referrer (&ir)" or "Is Debug (&_dbg)".

Suggested solutions

  1. Introduction of "additionalQueryParams" field
    A simple solution to address this limitation would be to provide an additional preference field called "additionalQueryParams" in the tool's preference menu. This field would allow users to add query parameters as-is, without any additional prefixes. It's important to make sure that the settings data takes precedence over the event/generated data.

  2. Implement argument selection drop-down
    A more user-friendly and robust solution would be to implement a feature that allows users to select individual arguments from a drop-down list in the tool settings menu, eliminating the need to manually type them in. The GA4 Measurement Protocol Cheat Sheet (https://www.thyngster.com/ga4-measurement-protocol-cheatsheet/#) provides a good reference.

Expected Results
Implementing either of these solutions would greatly improve the flexibility and usability of the component. It will allow users to set arbitrary query parameter values using JSONata. This will help prevent forking of the component, which would lock users out of further updates.

@scamiv thanks for raising this.
Let me look into this and get back to you.

Is there any update on this one ? I would glady help with updating https://github.com/managed-components/google-analytics-4/blob/main/src/requestBuilder.ts#L140-L150 with the properties from https://www.thyngster.com/ga4-measurement-protocol-cheatsheet but only if you are actually going to approve this