GoogleTagManager
Last updated
Last updated
Sign up for Google Tag Manager and .
Add the to your site.
During development and testing it is often helpful to use Google Tag Manager's Container Preview mode. Follow the instructions to enable it.
Install the target:
You may also provide an options object when creating the target:
Only event objects with an event
property will trigger a Custom Event in Google Tag Manager.
If you return anything but an object from an event definition
(e.g. undefined, null) then the target will skip over that event and won't
push anything to window.dataLayer
.
This target will push all generated event objects to the window.dataLayer
by default. As detailed in the .
If an event object doesn't have an event
property, but has a hitType
property, this target will create an event
property and set it to the hitType
string. This feature allows you to use the event definitions exposed by the For example: