如何使用Google跟踪代码管理器检索URL参数 [英] How to Use Google Tag Manager to Retrieve URL Parameters

查看:99
本文介绍了如何使用Google跟踪代码管理器检索URL参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个Facebook像素ID,这些ID将作为URL参数传递(即第一个像素'fbpid = 123456789'-第二个像素'fbpid = 987654321'等)

I have multiple Facebook Pixels ID that will be passed as URL parameters (i.e. first pixel 'fbpid=123456789' - second pixel 'fbpid=987654321' etc.)

每当用户单击某个按钮时,如果URL参数为'fbpid = 12345679',则仅应触发像素ID 123456789.

Whenever a user clicks a certain button, if the URL parameter is 'fbpid=12345679', then only the pixel ID 123456789 should be fired.

相反,如果URL参数中的像素ID为'fbpid = 987654321',则仅应触发ID为987654321的像素,依此类推.

Instead, if the pixel ID in the URL parameter is 'fbpid=987654321' then only the pixel with the ID 987654321 should be fired, and so on.

我该如何在GTM中检索URL参数并仅触发作为URL参数传递的Facebook像素ID?

How could I retrieve the URL parameter in GTM and fire just the Facebook pixel ID passed as URL parameter?

推荐答案

转到变量,自定义变量,新建,选择"URL"作为变量类型,选择"query"作为组件类型,并选择"fbpid"作为查询键.如果网址中存在查询参数,则将返回fbpid的值.

Go to variables, custom variables, new, select "URL" as variable type, "query" as component type and "fbpid" as query key. This will return the value for fbpid if the query parameter is present in the url.

然后您可以在触发器中使用该值(即创建一个页面加载触发器,在某些事件上触发,条件fbpid等于123456789).

You can then use the value in a trigger (i.e. create a pageload trigger, fire on some events, condition fbpid equals 123456789).

这篇关于如何使用Google跟踪代码管理器检索URL参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆