Advanced: UET Custom Event and Variable Revenue reporting via GTM

Basics first

There are a few things you need to do before you set up a custom event and variable revenue reporting using Google Tag Manager (GTM.)

If you want to pass UET custom events and/or variable revenue via GTM, you need to do the following in GTM:

  1. Set up GTM Variables to read dynamic values from your page
    • Variables are name-value pairs for which the value is populated during runtime.
  2. Set up the Trigger for when to report UET custom events/revenue
    • Triggers attached to a tag govern when the tag is fired or not fired.
    • A tag must have at least one trigger to fire. Triggers are evaluated during runtime and associated tags are fired (or not fired) when the trigger conditions are met.
  3. Set up the custom JavaScript required to report the UET custom event/variable revenue as a Tag. You can use GTM variables you set up above as part of the tag.
  1. Step 1. Let’s first start with Setting up GTM variables (a. above). While GTM supports many variants (read from html elements, functions, variables etc), in this sample we`ll set up GTM variables to read JavaScript Variable on the website.
    • Our GTM samples webpage source code has the following 5 variables

    • These we are reading into our GTM by creating new user defined variables
      • Create a new User-Defined Variable from New in the Variables page.

      • Name your variable (called EventAction in this example) and select JavaScript Variable type.

      • Define Global Variable Name, this variable need to same as in your website's code.

      • Now, repeat above steps and create a new variable for each custom event that you want to track. In this example, we created 5 variables to track custom events and variable revenue.

  2. Step 2. Set up a new Trigger (b. above) by Clicking New on Trigger page. In our example, we have set up the trigger as the click on a button on our sample page (with id=btnCustomEvent)

  3. Step 3. Now create a Tag and add newly created variables (Step 1) and trigger (Step 2) to report customer event or variable revenue.

  4. Step 4. Publish the changes from your Workspace.

  5. Step 5. Verify you have update your website’s source code to report custom events and variable revenue.

  6. Step 6. Validate tag is working correctly using UET Tag Helper, confirm variable revenue and custom events are being fired.

Additional help