Analytics
3.6K members online now
Discuss discrepancies between AdWords and Google Analytics data, linking AdWords and Google Analytics, importing your goals/Ecommerce transactions into AdWords, and setting up Remarketing
 
Guide Me
star_border
Reply

Manually passing gclid to GA

MCL
Visitor ✭ ✭ ✭
# 1
MCL
Visitor ✭ ✭ ✭

Hi all,

 

Newbie to GA has a quick question.  Is there a way to manually pass gclid values to GA the way we can with UTM values?

 

ga('set', 'campaignKeyword', 'Blue Shoes');

 

 

1 Expert replyverified_user

Re: Manually passing gclid to GA

Rising Star
# 2
Rising Star
Please let me know if I've misinterpreted, but I think you want to get the AdWords values into Google Analytics. You do this by linking your AdWords and GA accounts together like this: https://support.google.com/adwords/answer/1752125?hl=en
_________________________________________________________________________
Director of Marketing | Nehmedia | Partner Profile

Re: Manually passing gclid to GA

MCL
Visitor ✭ ✭ ✭
# 3
MCL
Visitor ✭ ✭ ✭
Hi Phillip,

Sorry, that's not quite what I was asking. I have already linked adwords and ga accounts. And normally, that's all one would need to do. But I wanted to hide the gclid from the url by grabbing the value and then forwarding the user to a clean url. Then I would need to pass the gclid value manually to ga, and this last part is what I was trying to figure out (if possible).

Re: Manually passing gclid to GA

[ Edited ]
Rising Star
# 4
Rising Star

You're entering MacGyver country - the first step in pulling off what you want to do begins with "Using mod_rewrite on the server, create a cookie prior to redirecting..."

Why not just skip auto-tagging? Use AdWords tags for your conversion tracking, and use your own scheme instead of the tag. If you want it completely clean URL, create a page that is noindexed and only reachable by a particular ad (say, "www.example.com/offers/buyme22") then simply manually pass GA the campaign, medium, source, etc. Add in a referral check to account for shared URLs and you are done.

_________________________________________________________________________
Director of Marketing | Nehmedia | Partner Profile

Re: Manually passing gclid to GA

MCL
Visitor ✭ ✭ ✭
# 5
MCL
Visitor ✭ ✭ ✭
I did consider that, but I feared that it could be tedious and error-prone if I want to do it at ad group level (in order to capture ad group name for utm_content value).

Re: Manually passing gclid to GA

Rising Star
# 6
Rising Star
I'm afraid any solution that eliminates the query string values (either the gclid or value track parameters) will be either or both tedious and error-prone. I'm curious and possibly missing something important - is there an issue you feel requires hiding the gclid?
_________________________________________________________________________
Director of Marketing | Nehmedia | Partner Profile

Re: Manually passing gclid to GA

MCL
Visitor ✭ ✭ ✭
# 7
MCL
Visitor ✭ ✭ ✭
The hiding of query string values is not an issue. We have been doing that for years. We do that primarily so that users see clean urls and when they forward our links to others, all referral codes (whether gclid or value track parameters) are not included. If they are included, clicking on the links will lead to wrong attribution.

Re: Manually passing gclid to GA

Rising Star
# 8
Rising Star
Got it - I've fixed this before - although for manual campaigns, not gclid. But the same approach would work here. You could do it at the server - use mod_rewrite and redirect to a clean URL if the URL has a gclid and the referrer is NOT google. Or you could use Google Tag Manager to rewrite the URL sent to GA without the gclid using a similar referrer rule. FYI I've personally not tested the GTM option with glcid but I see no reason it wouldn't work - it would be a simple test.

ref: https://support.google.com/analytics/answer/4588454?hl=en#what-does-gclid-represent
_________________________________________________________________________
Director of Marketing | Nehmedia | Partner Profile

Re: Manually passing gclid to GA

MCL
Visitor ✭ ✭ ✭
# 9
MCL
Visitor ✭ ✭ ✭
Oh, I see your approach. We don't usually like to depend on the http referer because it's not always available, but let me check what percentage of visits have no referrers.

Re: Manually passing gclid to GA

Rising Star
# 10
Rising Star
Here is the official info from AdWords (https://plus.google.com/u/0/+GoogleAds/posts/TmV9uHRrpKS) and yes, it is possible for a legit ad click to have no referrer but I've never seen it in the wild. With most browsers respecting the <meta content="origin" name="referrer"> tag (which Google uses) you should see the google referrer even if your site doesn't use SSL. So if a visitor had no referrer and a gclid, you could assume it was not a Google AdWords click but a shared/bookmarked/emailed URL.
_________________________________________________________________________
Director of Marketing | Nehmedia | Partner Profile