How to add Dynamic remaketing Tracking Code into global head

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Hi ,

I need how to help -- to add below tracking code in Global header page across all pages.

<script>
   var dataLayer = []; // Declare this array, if its not defined already in the code
   dataLayer.push({
     'ecomm_prodid':'<product_id>', // In case you need to capture attributes for multiple viewed products, use an array (Ex: [<product_id1>,<product_id2>]).
     'ecomm_pagetype':'<page_type>',
     'ecomm_totalvalue':<product_price>
   });
</script>



Also I need existing labels on webpages  for (<product_id>, <page_type> & <product_price>)

Thanks
4 years ago
Have you tried using Custom <head> tag in general setting's seo section?
{yourStore.com/Admin/Setting/GeneralCommon}
4 years ago
Ok , I will add it there and check if it works.

Can you help in editing the code ?
It requires some changes for labels.

Thanks
4 years ago
The above field will allow you to include static content in all pages.
If you want product name and different attributes in product page(dynamic), you may need to create a separate plugin
4 years ago
Hi , Below is message from the Google Tag implementation team requesting to add script to website to enable dynamic re-targeting. Please let me know your understanding and how to add these.

Start Message --->

However, kindly refer the code below that needs to be modified according to your product details and paste it in global header section of the website:



<script>
   var dataLayer = []; // Declare this array, if its not defined already in the code
   dataLayer.push({
     'ecomm_prodid':'<product_id>', // In case you need to capture attributes for multiple viewed products, use an array (Ex: [<product_id1>,<product_id2>]).
     'ecomm_pagetype':'<page_type>',
     'ecomm_totalvalue':<product_price>
   });
</script>


Note:
1. Add the above data layers to all the webpages which list the products you want to retarget via dynamic remarketing:
(Ex: The page can be a product detail page, shopping cart page, checkout page, etc,.)
2. Kindly replace the respective value in your webpage for the labels (<product_id>, <page_type> & <product_price>)



We will follow up with you via email, to confirm implementation of the changes, shared.


Should you have questions/clarification regarding implementation of the code, feel free to email us, and we would be happy to assist.


Thank you for your continued partnership with Google.


Best,
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.