0

I want to send different events tags to GA4 from GTM, and for every custom parameter used, I have to manually create it inside GA4 (to be available in the GA4 UI). Is there a way to custom code it in GTM and create it along with the tag?

Did not find anything that could help.

  • Have you looked at the Google Tag Manager documentation? It reads add a Variable and give it the type "Custom JavaScript". You can add any JavaScript that you want in there. See [GTM docs: Custom JavaScript](https://support.google.com/tagmanager/answer/7683362?hl=en&ref_topic=9125128&sjid=3773171783934582007-EU#custom_javascript). Is that what you mean? – Peter Krebs Aug 16 '23 at 12:05

1 Answers1

1

No, it's not possible to do it via GTM. Either you have to create it manually in GA4 UI or use the GA4 Admin API to create it programmatically.

Alternatively, you may try Google Analytics Utilities to create custom dimensions/metrics using Google Sheets/Appscript.