What are variables of element of Davinci2.0 for using in Data layer for creating Dynamic remarketing?

daica85

New Member
Hi team,

I'm setting a Dynamic Remarketing campaign in Google Ads, when setting up, it requires tags and event code snippet added to the code.

However, I don't know which variables on the template to pass on:

Instruction: https://developers.google.com/adwords-remarketing-tag/parameters

ecomm_prodid: Required. This is the product ID of the product or products displayed on the current page - the IDs used here should match the IDs in your GMC feed.
ecomm_pagetype:
Indicates the type of page that the tag is on. Valid values:
  • home: Used on the home page or landing page of your site.
  • searchresults: Used on pages where the results of a user's search are displayed.
  • category: Used on pages that list multiple items within a category, for example a page showing all shoes in a given style.
  • product: Used on individual product pages.
  • cart: Used on the cart/basket/checkout page.
  • purchase: Used on the page shown once a user has purchased (and so converted), for example a "Thank You" or confirmation page.
  • other: Used where the page does not fit into the other types of page, for example a "Contact Us" or "About Us" page.
ecomm_totalvalue: This parameter should be used on product, cart and purchase page types and should contain the value of a single product on product pages, or the total sum of the values of one or more products on the cart and purchase pages. The value should be passed as a javascript Number and should not include any currency symbols.

ecomm_category: This parameter contains a string specifying the category of the currently viewed product or category pages. The string can be any value and does not need to conform to any specific naming convention.

Example:
gtag('event', 'page_view', {
ecomm_pagetype: 'product',
ecomm_prodid: 111111,
ecomm_totalvalue: 9999.99,
ecomm_category: 'Home & Garden',
isSaleItem: false
});

Where can I find these variables in the template?

Thank you,
 

daica85

New Member
<!-- Event snippet for Example dynamic remarketing page -->
<script>
gtag('event', 'page_view', {'send_to': 'AW-123456789',
'ecomm_prodid': 'REPLACE_WITH_STRING_VALUE',
'ecomm_pagetype': 'REPLACE_WITH_STRING_VALUE',
'ecomm_totalvalue': 'REPLACE_WITH_STRING_VALUE'
});
</script>

I meant which string values to replace with the red text for every single product.
 
E

Ekaterina Sayapina

Guest
<!-- Event snippet for Example dynamic remarketing page -->
<script>
gtag('event', 'page_view', {'send_to': 'AW-123456789',
'ecomm_prodid': 'REPLACE_WITH_STRING_VALUE',
'ecomm_pagetype': 'REPLACE_WITH_STRING_VALUE',
'ecomm_totalvalue': 'REPLACE_WITH_STRING_VALUE'
});
</script>

I meant which string values to replace with the red text for every single product.
Hello,

These variables are not defined globally in the plugin. So, we'd recommend using GA Enhanced Ecommerce add-on for these purposes, our free solution for GA.
One thing to keep in mind: the ecomm_pagetype parameter is missing in the add-on. We'll add it in the nearest future.
 

daica85

New Member
I researched and got them with the codes below. It returned the values which I want for each product.

<script>
var dataLayer = [];
dataLayer.push({
'ecomm_prodid': '<?php do_action( "adstm_init_product" ); echo adsTmpl:: product("post_id") ?>',
'ecomm_pagetype': ' ',
'ecomm_totalvalue': '<?php do_action( "adstm_init_product" ); echo adsTmpl:: product("salePrice") ?>'
});
</script>

I think it's easy as you guys developed the theme and know exactly these server variables. I'm not sure if there's another way to get these variables.
 
Top