seo - Google tag manager Track page by content -
i created google analytics account website , created google tag manager account too. , both of accounts linked , working well.
i have new requirement , client wants users allow chance edit there webpage , create custom templates.
scenario ,
user log in system go genaral page use genaral page or edit genaral page , create custom template next time user log in system , go genaral page , user created custom template appear genaral page, but same url
if can point , same url content different ,
i applied google tag manager track pages, because of having same url tracking same url,
but want track page content , track user if user used genaral template or custom template.
hope 1 have idea how create google tag or macro or rule , or custom java script it.
thanks in advance
by far best way include datalayer variable templates indicated template being used. best include above tag manager code:
<body> <script> datalayer = [{ 'template': 'default', }]; </script> <!-- google tag manager --> ... <!-- end google tag manager --> so it's immediatly available when gtm code loads. create datalayer variable in gtm reads value "template" key datalayer , pass hit based custom dimension google analytics (i.e. in property settings in ga under "custom definitions" create new custom dimension , set scope "hit"; in gtm go "more settings/custom dimensions", add numeric index of dimension have created , pass new datalayer variable dimension value). can segment page hits in google analytics based on template type.
i'm sure possible track content (i.e. load content js string variable, create hash value string , send custom dimension), mean fixing typos result in new id. using variable per template seems more prudent.
Comments
Post a Comment