Using Google Tag Manager to define the page type

Posted by Daffy on Pro Webmasters See other posts from Pro Webmasters or by Daffy
Published on 2013-07-01T16:18:24Z Indexed on 2013/07/01 16:30 UTC
Read the original article Hit count: 117

Filed under:
|

So, I am looking to add a tag that I want to use for A/B testing, however we don't have a page-type URL structure. Fortunately the tool can recognise page type if I pass it by Javascript.

<script type="text/javascript">
window.isProductPage = true;
</script>

I have been told to use the above, I have created the script in Google Tag Manager (GTM), however I now need to know how to make this run on those pages in GTM.

I have looked through the code and there are div class that are unique to each page, can I use this as an indication of page type?

© Pro Webmasters or respective owner

Related posts about JavaScript

Related posts about tagmanager