Learn business growth with Google Analytics 4 Forums Google Analytics 4 Implementing event parameters in Google Tag Manager API: A step-by-step guide

  • Implementing event parameters in Google Tag Manager API: A step-by-step guide

    Posted by Sofia on 3 May 2023 at 11:17 am

    “Hey there, I’ve been trying to build a GTM event tag for Google Analytics 4 and I want to include some event parameters. I’m so close I can taste it because the API recognizes the eventParameters key, but it’s giving me a head-scratching error message: “vendorTemplate.parameter.eventParameters[0]: The value is invalid.”. If I just rename this key, the query slides through but kinda ignores my eventParameters, so I know I’m on the brink. Has anyone found a complete guide to these API queries? It’s been a lot of guesswork so far. Once I crack it, I’ll share a sample to automate trigger and tag creation for all the GA4 migrations out there. Here’s what I’m working on, any leads?”

    Charlotte replied 11 months, 2 weeks ago 3 Members · 2 Replies
  • 2 Replies
  • Owen

    31 May 2023 at 7:04 pm

    Sure. You’re on the right track. Your parameters are arranged as an array. Take a look at this example. You’ve got a “map” type, within are elements that each have a “type,” “key,” and “value.” To slide your variable into the value, keep going the way you’ve been using in GTM UI. So, something like {{DataLayer-Ecommerce}}. You’re nearly there, hang in there!

  • Charlotte

    2 June 2023 at 6:36 pm

    It appears that you are experiencing a problem when trying to include event parameters within the Google Tag Manager (GTM) API for Google Analytics 4 (GA4). This is likely due to an error within the structure of your code or the particular value you are providing for the ‘eventParameters[0]’ key is not being recognized by the API. It is recommended to refer to the Google Tag Manager API documentation and GA4 guides to ensure that your syntax is correct and the values you are providing for these parameters are valid. You may also want to search on online forums or reach out to Google’s support for further assistance.

Log in to reply.