1

I want to forward UTM source tracking on all the links on an amp page if UTM is present on the page URL itself.

Example: If UTM is present on some page abc.amp?utm_source=someSource then I want to track the UTM on the links of this page also. The best way would have been cookie (Since it can be tracked along multiple pages) but since AMP doesn't support Cookies and JS solution, any idea how to achieve this???

Ankur Aggarwal
  • 2,993
  • 5
  • 30
  • 56
  • I think there is an open issue regarding utm : ["Campaign UTM Parameters Not Passed Through to GA"](https://github.com/ampproject/amphtml/issues/2685). You may want to check this out before implementing this to your production server. By checking the update you may have your answer on how to properly implement utm source in AMP page. Hope this helps. – Mr.Rebot Apr 24 '18 at 17:12
  • For current page, it is working... But I want it to automatically forward to all the links inside my current page – Ankur Aggarwal Apr 25 '18 at 06:15
  • Hi @AnkurAggarwal Have you found a solution? thank you in advance – questionasker Feb 18 '21 at 09:36

2 Answers2

0

You would need to use QUERY_PARAM and add the UTM to each clickable link in your pages. Alternatively, you could use amp-bind, and fire off to an API end-point, using the CLIENT_ID as reference of the initial UTM data, and save it to your database. You would then be able to see where a user came from (for your own sources), and if you are using Google Tag Manager, see what their activity was going through your site as well.

Banana
  • 2,435
  • 7
  • 34
  • 60
0

For passing UTM parameters from one page to another use this

<script>
    $('a').each(function(i, el){
        $(this).attr({
            href: $(this).attr("href") + window.location.search
        });
    });
</script>
Eric Korolev
  • 713
  • 8
  • 13