I have found several posts asking for custom head code per page but none with a solid solution, so I’m hoping I have just missed the aha moment post somehow …
Our site represents franchisees, each of which has their own location page, and many of them want to add analytics tags to ONLY their pages, not the whole site. … and I am stumped on how to add custom code to just their pages within the /head tag and just before the /body tag.
I’m OK using something like this in the global /head / body areas, but have yet to be able to make it work…
if (window.location.pathname == ‘RELATIVE-PATH-TO PAGE’)