Highlighted

Is it possible to set load rules to fire on single-page sites where the URL includes a hashtag?

Rookie Contributor
I'm trying to set load rules to fire on a single-page site, however I find that the '#' in the URL interferes with the load rule and the tag does not fire. Is there a way to have the tags fire without changing the URL structure? I'm trying to capture various locales, so the load rule needs to contain more than just the word after the hash tag. ex. tealiumiq.com/de/questions#new - load rule cannot just be 'contains(ignore case) new' as that would pull in all of the locales.
6 REPLIES 6
Highlighted

Is it possible to set load rules to fire on single-page sites where the URL includes a hashtag?

Hi Kiran, are you trying to target against the hash, or to ignore it? Have you tried url "ends with #new"? or if you're trying to ignore the hash, did you try using pathname instead of URL? The pathname for your example would be "/de/questions". Or some combo like "url ends with #new" and "pathname contains /de/"
Highlighted

Is it possible to set load rules to fire on single-page sites where the URL includes a hashtag?

Rookie Contributor
Trying to target it but i've tried to ignore the hashtag in load rules as well, hoping that it would work. I've tried load rules like contains 'new' and contains 'de' but unfortunately that didn't work. Seems like the hashtag blocks load rules from including it and whatever comes after it. I'll try using pathname instead of URL and see if that works. Thanks for the suggestion.
Highlighted

Is it possible to set load rules to fire on single-page sites where the URL includes a hashtag?

Tealium Employee
The anchor will only be part of the URL. The pathname only includes the part of the URL after the domain then up to and including the filename. I find it odd that the # is causing issues as I've used this successfully before. I would suggest contacting your AM and having a Solutions team member look into this. We'll be able to check the code and figure out where the issue resides.
Highlighted

Is it possible to set load rules to fire on single-page sites where the URL includes a hashtag?

Tealium Expert
Tealium Expert
Any follow-up on this topic? The reply above is classic for this community... "contact your AM and have a solution team member investigate", but this offers little learning opportunity/value for folks researching after the fact. We don't know if the problem was solved nor how to solve it in the future.

</end rant> thanks for the bandwidth.
Highlighted

Is it possible to set load rules to fire on single-page sites where the URL includes a hashtag?

Tealium Employee

Hi @mitchellt:

 

Certain questions often require looking at the code of the website and using debugging tools to determine the root cause of the issue. Many clients are hesitant to provide specifics over the community, and sometimes require very specific steps to reach a flow of the site, therefore we often request contacting the AM so we can gather more details. Granted, we could do a better job following up, and we now have community managers in place to help assist with followup :)

 

To answer your question, we have created a new system variable "hash" that can be used to look at anything after the "#".

 

For example, the following URL:

http://test.tealium.com/as/index.html?key=value#hash

 

Will output:

dom.domain : "test.tealium.com"
dom.hash : "hash"
dom.pathname : "/as/index.html"
dom.query_string : "key=value"
dom.referrer : ""
dom.title : "Tag Management and Real-Time Customer Data | Tealium"
dom.url : "http://test.tealium.com/as/index.html?key=value#hash"

So when creating a Load Rule you can choose "hash" from the first drop-down.

hash load rule.png

 

Please let me know if this does not answer your question. If not, please provide details of your issue and we'll do what we can do find you an answer.

 

Cheers,

-Dan George

Highlighted

Is it possible to set load rules to fire on single-page sites where the URL includes a hashtag?

Tealium Expert
Tealium Expert

Thanks for the reply Dan, and apologies to all for hijacking a thread.  I definitely understand that we all can't share but so much proprietary info in this community, but for the sake of community I hope we can all be better at posting resolutions to help others coming behind us.

 

Thanks for posting the detailed explanation Dan!