Taking the pageviews of urls

二次信任 提交于 2020-01-04 19:14:08

问题


I have a site and I want to take the pageviews for specific urls using google tag manager and datalayer variables.

Example urls

http://www.test.com
http://www.test.com/e-shop
http://www.test.com/contact

I create datalayer variables with home eshop contact

After I set the following trigger using every datalayer variable as custom events

home
eshop
contact

After that what code should I write in tag I have named it Pageviews in order to have this variables in google analytics?

Is there any easier way to make it but again using datalayer?


回答1:


You don't necessarily need a custom dataLayer variable for this. I would do it this way:

Create a new Tag

  1. Product: Google Analytics
  2. Tag Type: Universal Analytics
  3. Configuration:
    • Track Type: Page View
    • Tracking ID: your Tracking ID
  4. Fire on:
    • Some Pages

In the overlay popping up on step 4, add 3 new triggers as follows

| Name     | Variable     | Operation     | Value     |  
| Home     | Page Path    | equals        | /         |  
| E-Shop   | Page Path    | equals        | e-shop    |  
| Contact  | Page Path    | equals        | contact   |

Save and test your new tag in preview mode. This setup will use the event dataLayer variable behind the scene, which sends a "Page View" event by default.



来源:https://stackoverflow.com/questions/31732017/taking-the-pageviews-of-urls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!