I am having issues scoping Join Data Values extensions to multiple or all tags.
In this scenario I am firing 1 tag on one area of the site and a 2nd tag on another area of the site.
f_pname and page.l2 are defined and populated on both site sections but when I scope to all tags the logic does not complete on both tags.
However if I duplicate this extension and scope each extension primarily to each tag the logic succeeds.
The join is as follows
Join f_pname to page.l2 when page.l2 is defined and populated
So, in order to make this work I have to have Join Extension 1 scoped to Tag A and the duplicate extension scoped to Tag B
Any help is appreciated. Thanks!
I've never had an issue with the Join Data Values Extension when scoped to any scope. It sounds like page.l2 is not defined in time when the Join Extension is scoped to All Tags.
When an extension is scoped to a specific tag it runs quite a bit later during page load then if it is scoped to All Tags.
One thing to check is when page.l2 is defined.
Is it getting defined in another extension? If so, is that extension above the Join extension in the list of extensions? What is the scope of the extension setting page.l2
You could scope the Join Data Values extension to All Tags. Then add a JS Code extension that outputs the "b" object in the console of Developer Tools to see what is available right before that extension runs.
Add this to a JS Code extension. Make sure the JS Code extension has the same scope (All Tags) as the Join Data Values extension, and make sure the JS Code extension is directly above the Join Data Values extension in the list of extensions.
Add this to the JS Code extension:
utag.DB("**** Data available for Join Data Values Extension *****");
This will output all the data that is available when the Join Data Value Extension runs.
I did check the order of the extensions as I did suspect the page.l2 was not being populated in time for the join - I think I will take another look at that and also use your JS Code. I will keep you posted.
Just a quick note - you can also scope extensions to more than one tag (although it sounds like it won't be needed in this case).
Just choose the additional tags in the scope selector. There is no need to make a copy of the extension. This means there is a single location to change if you need to make any updates to the logic in the future.