- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
Hi,
we are looking for a solution for the following problem: On our single page website, we have implemented page specific data variables (e.g. page_type, page_id). These are passed with the call to utag.view() like this:
utag.view({"page_type": "home", "page_id": "123"});
To ensure, that the data is not sent on subsequent pages without these parameters, the values are mapped to "pageview-dimensionX" in the Google Analytics tag.
Now we would like to have these values also sent on link events, to see in GA which events fired on the page with ID "123". Is there a way to achieve this?
We can't use the "set" option, as in this case there is no way to clear the variable (an empty value means it is not passed to the GA tag).
Do you know a way to persist a page value through several link events and only reset it in case of a new view event?
Best regards,
Andreas
Solved! Go to Solution.
08-04-2017 08:30 AM - edited 08-04-2017 08:31 AM
Hi @ahrasch
From how you have described this, I think your best bet is to use an extension to help you out.
What you would need to do is have a variable, say utag.data.current_page_type = b.page_type
and utag.data.current_page_id = b.page_id
, which you update when the view happens.
Then when you call a utag.link() call, you can then retrieve the data store in these data sources, put them into their respective data sources b.page_type = utag.data.current_page_type
and b.page_id = utag.data.current_page_id
and map accordingly, when you need to set them.
Adrian
Remember to give me a kudo if you like my post! Accepting my post as a solution is even better!
Copyright All Rights Reserved © 2008-2023