custom event trigger in google tag manager

11,384

It's a bit unclear from your question how you set this up. It should look like this:

dataLayer.push({
   'event':'myEvent'
})

(this assumes that the dataLayer is already initialized).

In GTM you go to the "variables" section. In the boxes with the predefined variables you hit the checkbox in front of "event". Now you're ready to use your custom event in a trigger.

Go to "trigger", select new -> custom event. In the event name box you enter "myEvent" (as per my example, substitute with your own value).

The custom event only works when there is a key/value pair in the dataLayer where the key is "event" (that's kind of a 'reserved word' in GTM). The event name is always the value for that key.

Share:
11,384
owais
Author by

owais

Updated on June 04, 2022

Comments

  • owais
    owais almost 2 years

    Every time i create a custom trigger event it doesn't get fire. Can anybody please what may be the reason. I have created 'gacustomevent'custom triggerand have name it 'gaevent' but the event is not getting fired. Iwant to use the event in the dataLayer to capture the value. Any advice on how to get issue resolve