问题描述
我有一个网站,我想使用google标记管理器和数据层变量获取特定网址的综合浏览量。
I have a site and I want to take the pageviews for specific urls using google tag manager and datalayer variables.
示例网址
http://www.test.com
http://www.test.com/e-shop
http://www.test.com/contact
我使用
home
创建数据层变量eshop
联系
I create datalayer variables withhomeeshopcontact
我使用每个数据层变量设置以下触发器作为自定义事件
After I set the following trigger using every datalayer variable as custom events
home
eshop
contact
之后我应该在标签中写什么代码我已将其命名为Pageviews以便在谷歌分析中使用这些变量?
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?
推荐答案
您不一定需要自定义dataLayer变量。我会这样做:
You don't necessarily need a custom dataLayer variable for this. I would do it this way:
创建新标签
- 产品:Google Analytics
- 代码类型:通用分析
- 配置:
- 跟踪类型:网页浏览
- 跟踪ID:您的跟踪ID
- Product: Google Analytics
- Tag Type: Universal Analytics
- Configuration:
- Track Type: Page View
- Tracking ID: your Tracking ID
- 一些页面
在步骤4中弹出的叠加层中,添加3个新触发器,如下所示
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 |
在预览模式下保存并测试新标签。此设置将使用场景后面的事件
dataLayer变量,默认情况下会发送Page View事件。
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.
这篇关于获取网址的综合浏览量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!