Ability to adjust Treepl generated gtag code?

So i have a client that i need to be able to send custom data through Google Analytic events. However as the code is generated by the Treepl renderer and we don’t have control over it, i can’t send custom data/metrics.

I need to be able to adjust the gtag accordingly:

gtag('config', 'GA_MEASUREMENT_ID', {
  'custom_map': {'metric<Index>': 'metric_name'}
});

Specifically adding the custom_map object. (https://developers.google.com/analytics/devguides/collection/gtagjs/migration#send_custom_dimensions_and_metrics)

Is there any possibility of this code getting generated to a box in the admin under the "Setup analytics page.

Ideally there would be a “reset to default” button in case we need to reset it, but a box to allow a sitewide modification to the gtag code?

Unless anyone else has another idea that i cant see :slight_smile:

1 Like

Something like this would also give us europeans a tool to implement { 'anonymize_ip': true } in the gtag code for GDPR compliance.

Hi @James. It was my understanding that was why they made the Tracking ID in the ‘Setup Analytics’ section not required. So you can omit that ID and the Google tracking code won’t be added by the system.
You can then manually add your own customised version as needed.
Only the ‘View ID’ and ‘Service Key’ is required to integrate the analytics dashboard.

This was introduced in v4.7 and the Docs have been updated here:
https://docs.treepl.co/documentation_group/site-settings-and-management/set-up-analytics#secSetupAnalytics

Does this solve the problem or am I missing something else?

Thanks @Adam.Wilson, I missed that!

I swear this wasnt here last I checked ha.

Yeah that should do it :slight_smile: ! Thanks @Adam.Wilson