Universal event in Google Tag Manager

If you track a lot of events and add new ones every now and then, you have to perform a series of the same operations:


  1. Hang an event on the site.
  2. Create a trigger in GTM.
  3. Create an event sending tag in GTM in Google Analytics.
  4. Create a tag in GTM for sending an event to Yandex Metric.
  5. If you are collecting data for retargeting on Facebook and VK, then for each of them you need to create another tag in GTM.

At the same time, the number of entities in GTM is growing and it becomes more and more tiresome to navigate in them. (GTM is also non-rubber and the number of entities allowed is limited.)


I came up with and implemented a solution that allows:


  • reduce the routine, eliminating steps 2-5;
  • do not produce tags;
  • streamline event management.

You only need to configure several entities in GTM once and do not touch it anymore when adding new events! Details in order.


Event on site


At the moment the desired event is triggered, we pass several parameters to the dataLayer:


dataLayer.push(
{
   'event':'universal_event',
   'event_category':'GA_category',
   'event_action':'GA_action',
   'event_label':'GA_label',
   'universal_event_systems':'google_analytics facebook metrika vkontakte',
   'universal_event_name':'retargeting_event'
});

Where


  • universal_event - event identifier for GTM;
  • GA_category, GA_action, GA_label - respectively, the category, action and event label for Google Analytics;
  • google_analytics facebook metrika vkontakte - systems to which the event will be transmitted. You can specify one or more separated by spaces or other delimiters;
  • retargeting_event - event identifier for systems other than Google Analytics.

GTM: Variables


GTM : event_category, event_action, event_label, universal_event_name, universal_event_systems.


image


GTM:


, . , universal_event_systems. universal_event.


image


image


image


image


GTM:


. GA event_category, event_action, event_label, universal_event_name.


image


image


image


image


!


Remember to test and post the changes to GTM.


Now when creating a new event on a site, you can simply transfer the desired configuration in the site code to dataLayer, and GTM does not even open it.


If you use Metric, you also have to create a javascript-event type target in it , specifying the value of the variable universal_event_name as an identifier .


All Articles