Reputation: 3101
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???
Upvotes: 1
Views: 1275
Reputation: 743
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>
Upvotes: 0
Reputation:
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.
Upvotes: 0