服务器端 Google Analytics——utm 变量
所以我在我的服务器上设置了一个页面,该页面将根据某些条件被调用。该脚本为谷歌分析创建 .gif 并访问他们的服务器。
我已经与我的客户确认他们看到了页面点击量;然而,有些人希望查看 UTM 变量(utm_campaign、utm_source、utm_term 等)。我似乎无法保留 UTM 变量,我已将它们附加到跟踪字符串,但它们看起来像是被删除了。这需要 UTME 部件吗?
<cfset TrackingStringFromEDOM = ("http://www.google-analytics.com/__utm.gif?" &
"utmwv=4.4sh&" &
"utmn=#RandRange(0,2000000000)#&" &
"utmhn=#URLEncodedFormat(urlDomainString)#&" &
"utmr=%2D&" &
"utmp=#URLEncodedFormat(utmp)#&" &
"utmac=#googleID#&" &
"utmcc=__utma%3D999.999.999.999.999.1%3B&" &
"utmvid=#id#&" &
"utmip=127.0.0.0"
) />
<cfoutput>#TrackingStringFromEDOM#</cfoutput><br/><br/>
<cfhttp method="get" url="#TrackingStringFromEDOM#" timeout="1000" />
So I have set up on my server a page that will be called depending on certain conditions. This script creates the .gif for google analytics and hits their server.
I've confirmed with my clients they're seeing the page hits; however, some want to see UTM variables (utm_campaign, utm_source, utm_term, etc...). I can't seem to get the UTM variables to stay, I've attached them to the tracking string but they look like they're being removed. Will this require the UTME piece?
<cfset TrackingStringFromEDOM = ("http://www.google-analytics.com/__utm.gif?" &
"utmwv=4.4sh&" &
"utmn=#RandRange(0,2000000000)#&" &
"utmhn=#URLEncodedFormat(urlDomainString)#&" &
"utmr=%2D&" &
"utmp=#URLEncodedFormat(utmp)#&" &
"utmac=#googleID#&" &
"utmcc=__utma%3D999.999.999.999.999.1%3B&" &
"utmvid=#id#&" &
"utmip=127.0.0.0"
) />
<cfoutput>#TrackingStringFromEDOM#</cfoutput><br/><br/>
<cfhttp method="get" url="#TrackingStringFromEDOM#" timeout="1000" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,我会稍微不同地编写变量:
另一件事是某些参数似乎不在 gif 参数列表中 - 请检查 http://code.google.com/intl/en/apis/analytics/docs/tracking/gaTrackingTroubleshooting.html#gifParameters
First I would write the variable a bit differently:
Another thing is some parameters don't seem to be in the list of the gif parameters - please check http://code.google.com/intl/en/apis/analytics/docs/tracking/gaTrackingTroubleshooting.html#gifParameters