After adding the Personalization Capture template to your Google Tag Manager workspace you can capture various page events in Personalization.
For an explanation of Google Tag Manager configuration, see Tags, triggers, variables, and the data layer.
Build an event used for tracking purposes. The following example uses an event labeled Add to Cart.
add_to_cart
.To map more metadata about the event, you must add column metadata for the event to Personalization. The following example captures the name of the product added as part of the Add to Cart event.
Product Name
1
Event
, for the Event
table.custom_field_1(getCustomField1)
(ensure you note the number for the field)String
Product name from Add to Cart
Sign in to Google Tag Manager.
Create a new tag titled Personalization - Event - Add to Cart.
In the tag configuration select the Personalization Capture custom template as your tag type.
In the Capture Type menu, select Event.
Enter add_to_cart
as the Event ID. Ensure the Event ID matches
the Event ID value generated in Personalization.
To capture the product name in Personalization, map the product name dataLayer variable to the column metadata field (event_udf1) created earlier. In the Event Custom Parameters section, enter the values:
event_udf1
{{product-name}}
After configuring the tag, you can create a new trigger or select an existing trigger. The following example, creates a new trigger from a form fill.
For more information on creating a new trigger in Google Tag Manager, see About triggers
Once the fields are mapped and have a trigger set, click Save to save the tag.
The tag will now capture any Add to Cart
event on the page the name of the
product added to the cart.