Start building loyal communities with targeted, gated offers.
data-purchase-amount
and data-locale
) to the head script. See below for a tutorial based on the integration you are using.
Google Tag Manager
Identify Variable Name
Product Price
would be product_price
.Add New Line to Head Script
el.setAttribute('data-purchase-amount', '{{variable_name}}');
and the variable name you noted in the previous step.el.setAttribute('data-purchase-amount', parseFloat({{variable_name}}) * 100);
Save and Publish
Manually added Head Script
<head>
section of your page, you can set the data attributes like this:Via inline placement
<body>
section of your page, you can set the data attributes like this:{{purchase-amount}}
: The price of the product, in cents (e.g. 1000 for £10).{{locale}}
: The locale of the page, in ISO 639-1 format (e.g. en-GB
).{{currency}}
: The currency of the page, in ISO 4217 format (e.g. GBP
).{{savings-amount}}
: The savings amount of the product, calculated automatically based on the original price and the discount in the campaign.==Save {{savings-amount}}== on this {{category}}
Then, you need to set the value for that variable (as “data attribute”) when rendering the placement. For example, if you want to set the category to “Shoes”, you can do the following:
Save £19.60 on these ShoesOf course, you will probably want to replace those hardcoded values with variables from your data layer (on Google Tag Manager, for example) or from your CMS.