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" />
有帮助吗?

解决方案

First I would write the variable a bit differently:

<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"
     />

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top