Post by account_disabled on Nov 22, 2023 5:18:44 GMT -5
This step and use Simo Ahava's Custom Tag Template . This dedicated blog would help you set it up with ease. Important: As explained by the author, this ready-to-use template will always fetch the latest version of the web-vitals library and will always take care of updating and fixing it when necessary. . Configuring a Custom Event Trigger Triggers are an essential element in GTM. They are event listeners developed to listen to specific events and tell the tag when to activate or block.
Without triggers, tags would be useless. Therefore, after Web Design and Development Service creating the tag, you need to set a dedicated trigger. As with the HTML Tag, setting up a new trigger is quite simple. Go to the Triggers sections and click on the “New” button. Next, start the setup by entering the trigger name, e.g. Web Vitals. In Trigger Configuration, select the “Custom Event” trigger type, under “Other” and set “web-vitals” as the event name. . Save Your custom event is now ready. . Setting Data Layer Variables After creating a custom HTML tag and its trigger, you are now ready to set data layer variables.
These objects are containers that you can fill with all the information (events, variables) you want to pass to GTM. They are composed of pairs of keys and values, which would be used to set the triggers. Each variable is used to push the event currency to the tag. Therefore, the number of variables depends on the number of events you want to monitor. For our purpose, we need to create different variables for the following values: event_category event_action event_value event_label quite simple, you just have to: Go to the “Variables” tab and click “New” in the “User Defined Variables” section.
Without triggers, tags would be useless. Therefore, after Web Design and Development Service creating the tag, you need to set a dedicated trigger. As with the HTML Tag, setting up a new trigger is quite simple. Go to the Triggers sections and click on the “New” button. Next, start the setup by entering the trigger name, e.g. Web Vitals. In Trigger Configuration, select the “Custom Event” trigger type, under “Other” and set “web-vitals” as the event name. . Save Your custom event is now ready. . Setting Data Layer Variables After creating a custom HTML tag and its trigger, you are now ready to set data layer variables.
These objects are containers that you can fill with all the information (events, variables) you want to pass to GTM. They are composed of pairs of keys and values, which would be used to set the triggers. Each variable is used to push the event currency to the tag. Therefore, the number of variables depends on the number of events you want to monitor. For our purpose, we need to create different variables for the following values: event_category event_action event_value event_label quite simple, you just have to: Go to the “Variables” tab and click “New” in the “User Defined Variables” section.