문제

I am trying to implement AdWords Dynamic Retargeting on an e-commerce website. The website in question has multiple product variants on a single product page. On initial page load, the google_tag_params array is setup properly:

<script type="text/javascript">
var google_tag_params = {
  ecomm_prodid: 'product_black',
  ecomm_pagetype: 'product',
  ecomm_totalvalue: '100.00'
};
</script>

However, when the user chooses a different variant (ie: product Color is changed) then I dynamically update the value of google_tag_params.ecomm_prodid as so:

google_tag_params.ecomm_prodid = 'product_red';

The google_tag_params array is updated as expected, but the new values for ecomm_prodid do NOT appear to be "sent to Google". When I run Google Tag Assistant on the page I always get back the initial ecomm_prodid (in this case, 'product_black') and not the new value that is currently set in the google_tag_params array.

My Question:

How do I dynamically update the value of ecomm_prodid after page load and send it to Google?

도움이 되었습니까?

해결책

The standard tag is fired once when the page loads, so your later changes to the google_tag_params object do not trigger the tag to fire a second time.

If you want to do multiple firings of the remarketing tag without refreshing the entire page then you can try using the asynchronous version of the remarketing tag that allows you to dynamically fire the tag as many times as your like based on user actions on the page.

There are some details about the asynchronous version of the tag here: https://developers.google.com/adwords-remarketing-tag/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top