Sync with Google Tag Manager (Retargeting in advertising campaigns)


If you don't specify your product SKU in Schema.org, Mysitemapgenerator generates its Unique Product Id. This Id is associated with the target URL and remains constant each time you create feeds using the Mysitemapgenerator.
You can easily sync your product IDs between MySitemapGenerator and Google Tag Manager.
Include our js-library in your template to display product pages:
<script type="text/javascript" src="//cdn.mysitemapgenerator.com/api/hashfunc.compressed.js"></script>
Then you can get the current MySitemapGenerator identifier into the Javascript variable on any landing page of your products.
var offerid = mysitemapgenerator_calchash_offerid(window.location.href);
An example of use with Google Tag Manager code:
<script type="text/javascript" src="//www.mysitemapgenerator.com/api/hashfunc.min.js"></script>
<script>
    var mysitemapgenerator_get_offerid = mysitemapgenerator_calchash_offerid(window.location.href);
    
    gtag('event', 'page_view', {
    'send_to': 'YOUR-GA-TRACKING_ID',
    'value': 'Your Current Best Offer Name',
    'items': [{
      'id': mysitemapgenerator_get_offerid,
      'google_business_vertical': 'retail',
    }]
  });
</script>