Overview
Google Tag Manager (GTM) allows users to deploy the Zaius Javascript Tag to their website in a few steps.
Locate the Zaius tag
To locate the Zaius JavaScript tag:
- In your Zaius account, click the Account Settings
icon in the main navigation bar.
- In the sidebar, select Integrations under the Data Management section.
- Locate and select the JavaScript Tag card to reveal its details.
- Below the embed code, select Copy to Clipboard.
Add the Zaius tag to GTM
To add the Zaius tag to your content via Google Tag Manager:
- In Google Tag Manager, click New Tag.
- Select the Custom HTML option.
- Paste the Zaius Javascript tag into the field.
- Choose to fire on All Pages. This configuration will capture data from every page view.
Configure additional events
Create additional "Custom HTML" tags to capture more robust customer behaviors and events. Each implementation should have triggers and variables configured that define when to fire the tags and what data to put in them. Some common custom tags are listed below:
Configure Customer Identification Events (customer log in/account creation)
zaius.event("customer",
{
action: "login",
customer_id: "{{YOUR_VARIABLE_FOR_CUSTOMER_ID}}", //note: or other identifier
email:"{{YOUR_VARIABLE_FOR_EMAIL}}",
}
);
Configure Product Interactions (product detail view and cart events)
zaius.event("product",
{
action: "detail",
customer_id: "{{YOUR_VARIABLE_FOR_CUSTOMER_ID}}",//note: or other identifier
email:"{{YOUR_VARIABLE_FOR_EMAIL}}", //note if email is not available do not send it
product_id: "{{YOUR_VARIABLE_FOR_PRODUCT_ID"}}
}
);
Configure Orders
Implementing this call should be done from a custom Javascript variable and requires the implementation of the eCommerce data layer in GTM.
The output of the variable should send an event like the following to Zaius:
zaius.event("order", {
action: "purchase",
customer_id: "zaius-342", //or other identifier
order: {
order_id: "OR345",
total: 109.65,
discount: 5.00,
subtotal: 103.00,
tax: 5.15,
shipping: 6.50,
coupon_code: "5OFF",
items: [
{
product_id: "2045",
price: 19.00,
quantity: 5,
discount: 0.00,
subtotal: 95.00
}, {
product_id: "2091",
price: 10.00,
quantity: 1,
discount: 2.00,
subtotal: 8.00
}
]
}
});