Highlighted

How to fire multiple Google Universal Analytics events in the same page?

Silver Contributor
Silver Contributor
With the eventAction, eventCategory and eventLabel attributes you can fire an event on each page load with Tealium. However, Google Analytics supports until 10 events on the same page. How can I fire multiple events without coding them with a JavaScript extension? I know how to do this with a JavaScript extension, but we are having issues with the execution times of the tag and the extensions. Thanks!
5 REPLIES 5
Highlighted

How to fire multiple Google Universal Analytics events in the same page?

Employee Emeritus
Hi Lluis, Thanks for your note. You are right to ask this question - there isn't an easy way to do this I'm afraid. Google's concept of queueing events to fire and then dispatching them all at once when analytics.js is called doesn't map to the 1-to-1 method that Tealium uses (i.e. you can't populate the same dimension more than once in a single call). The best way to meet this would be to have some event arrays. For example: event_action = ["event_action_1","event_action_2"]; event_category = ["event_category_1","event_category_2"]; event_label = ["event_label_1","event_label_2"]; Then, the Google Universal Analytics tag template would need to be customised to loop through these arrays and queue up multiple events in the same Tealium Call. I would recommend either: (i) Start using these arrays (or something similar) and then write a JS extension which would set the relevant GA syntax to trigger multiple events OR (ii) Get in touch with your account manager to see if we can provide you with a modified GUA tag template which would support what you need. I'm sure this is something which will get incorporated into the tag eventually but at the moment the only way would be to do as you already are doing (via the JS extension) or to customise the template for your need. I'll also reach out to one of our guys to see what they think in case there is a better way. Thanks, Roshan
Highlighted

How to fire multiple Google Universal Analytics events in the same page?

Silver Contributor
Silver Contributor
Hi Roshan, Many thanks for your answer! I like customising the GUA template, looping within the array values and firing the necessary events, depending on the array length. I will try getting it to work and get back to our account manager if I get in trouble. Please contact me if you find an easy solution :) Thanks again!
Highlighted

How to fire multiple Google Universal Analytics events in the same page?

Employee Emeritus
There's another option that actually exists in the template specifically for this already. If you create an array called 'b.ga_events' in an extension scoped to the GUA tag in the following format: [{eventCategory:"google event category here", eventAction:"google event action here",eventLabel:"google event label here",eventValue:"integer only valuie here},{eventCategory:"google event category here", eventAction:"google event action here",eventLabel:"google event label here",eventValue:"integer only valuie here}] It will actually fire multiple events whenever this array of objects is defined. It's kind of advanced though and requires all four data points for each 'event object' you want to fire in the array, so if you run into issues using it or need customizations, definitely contact your AM.
Highlighted

How to fire multiple Google Universal Analytics events in the same page?

Silver Contributor
Silver Contributor
Good morning Son, Wow, definitely I will try your option since seems to be the most standard one. Anyway, I will contact my AM in order to implement it properly. Many thanks for your support guys!
Highlighted

How to fire multiple Google Universal Analytics events in the same page?

Employee Emeritus
Awesome Son - I wasn't aware this was already built in!