09-19-2017 02:31 PM - edited 09-19-2017 04:32 PM
Step 1: I have accessed page www.test.com?oid=test1
Step 2: The page has link test2 with href ="/test2.html?oid=test2"
When I click on 'test2' link the qp parameter of page (oid=test1) is getting passed, rather than the one that is being set on link.
Requirement: I want oid = test2 to get passed, when I click on 'test2' link
Solved! Go to Solution.
09-20-2017 08:55 AM - edited 09-21-2017 07:09 AM
Hi @veerender_reddy, what I would do is create another data variable (UDO variable type, not qp) that grabs that part of the href string. Because the link is on the same page, clicking a link that contains an oid the browser does not recognize this as having or updating the querystring.
What you need to do is treat it as a string variable and split out that part using a jQuery onHandler extension mapped to your new variable (and narrow the conditions as needed), and use something like:
09-20-2017 11:59 AM - last edited on 09-20-2017 12:57 PM by kathleen_jo
@veerender_reddy Because querystrings are basically a "browser functionality" element, it is not best practice to hijack them for non-standard use. It can create unexpected problems in the user experience. It is also not possible to select a qp. variable in the interface to set a new data value in that way.
@STerjeson, In addition to what Veerender mentioned.
We need to send 2 tags as below.
1. Page view tag with "oid=test1" from the querystring on the page --> sent to a propX
2. Link click tag with "oid=test2" from the href of the link --> Sent to the same propX.
So, does it work fine, if I have 2 datalayer parameters(one qp & one UDO) and mapped to single propX ?
If so, would I still get page "oid=test1" on a link click tag(2nd case) when there is no "oid" in href of the link ?
oid_prop -- UDO variable to map to tag propX
oid_href -- UDO variable for link click value
qp.oid -- original URL qp value
2 Set Data extensions,
Then just have the consolidated oid_prop variable mapped in the tag as a single point of reference. This could probably be refined, but hopefully a starting point for you.
@ravi_thati One other option would be to just try setting in the js extension script (as part of the broader link call):
My only concern with that approach is the utag.data reprocessing sequence with a link or view event. One of the Tealium engineers might be better equipped to answer that more defintitively. I don't want to see your custom qp.oid overwritten when the utag.data reloads and may grab the querystring values again. If utag only pulls the querystring once on the initial call, then it might not be a problem. Its just not something I have directly tested before.
You are right, utag pulls the querystring values each time a tag fires. But anyway the extension runs after that, so there are no issues with it. I did a quick test with the JS extension approach and it seems to be working as per our requirement. I would probably go with that approach unless I see any other issues in my testing.