Add DataLayer Script to my theme to run Dynamic Remarketing Google Ads

Highlighted
New Member
3 0 0

Hi everyone,

Can you guys please help me. I would like to run Dynamic Remarketing Google ads for my shopify store, but I need to add a script as below:

 

<script>
dataLayer = [];
dataLayer.push({
'event': 'add_to_cart',
'value': 998.55,
'items': [{
'id': 1234,
'google_business_vertical': 'retail'}, {
'id': 45678,
'google_business_vertical': 'retail'}]
});
</script>

 

But before I can add this code to my theme, I need to change the Value, ID to match information with my shopify store. Where can I get this ID code and value? 

I use theme liquid. 

Thanks you.

 

0 Likes
Highlighted
New Member
1 0 0

Hey ,

I Know it's a bit late to answer this but if anyone needs the info : 

 

<script>
dataLayer = [];
dataLayer.push({
'event': 'add_to_cart',
'value': {{product.price | divided_by: 100.00}},
'items': [{
'id': {{product.id}},
'google_business_vertical': 'retail'}, {
'id': {{product.id}},
'google_business_vertical': 'retail'}]
});
</script>

0 Likes