AdWords
2.2K members online now
2.2K members online now
Dive into advanced features like Remarketing, Flexible Bid Strategies, AdWords Editor, and AdWords Scripts
Guide Me
star_border
Reply

Passing gclid in URL

Follower ✭ ✭ ✭
# 1
Follower ✭ ✭ ✭

Can you please give a sample of URL syntax for passing gclid as part of the URL?

 

I need it to be in a format similar to below for my tracker to pick it up

 

www.mytracker.com/s1=test&s2={gclid:}
www.mytracker.com/s1=test&s2=#gclid#

2 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Eric K
November 2015

Re: Passing gclid in URL

Top Contributor
# 9
Top Contributor
Hi Erik K,

Ok, here's another approach that might work for you if I'm understanding this correctly. Do you have a web site separate from the mytracker.com? If so, you could send the clicks to your web site, transform the URL to match Cake requirements, then forward the user to that URL.

Pete
petebardo -- Deadhead doing AdWords

View solution in original post

Re: Passing gclid in URL

Rising Star
# 2
Rising Star
Hi Eric,

Hope the attached link can help you, else wait for experts suggestions.

https://support.google.com/analytics/answer/2938246?hl=en

Regards
Archit, AdWords Rising Star, Community Profile
Did you find any helpful responses or answers to your query ? If yes, please mark it as the ‘Best Answer.’

Re: Passing gclid in URL

Top Contributor
# 3
Top Contributor
Hi Erik,

As far as I know, there is no value track variable for the gclid. It is attached automatically when you have auto-tagging enabled. It shows up in the query string of the landing page url. Using your example from above, it will look something like this:

www.mytracker.com/s1=test?gclid=dlafkjdlkfjadlfldjsa

Here's a previous conversation on the topic: https://www.en.adwords-community.com/t5/Tracking-Reporting/How-can-I-insert-GCLID-in-a-click-URL/td-...

You may be able to use some sort of URL rewrite, if you are using an Apache server, to get what you want. I have no idea how you would do that.

It's going to be something like this:

RewriteCond %{QUERYSTRING}% ^(gclid=)(.*+)[&|$]
RewriteRule www.mytracker.com/s1=test&s2=$2

That's completely untested on my part. It's just to give you an idea of what you might be able to do. I'd test this in a development environment first, if you can.

Best of Luck!

Pete
petebardo -- Deadhead doing AdWords

Re: Passing gclid in URL

Top Contributor
# 4
Top Contributor
Hi Erik,

Did a little digging on this as it caught my interest and it's something I may be able to use myself later on.

After a bit of testing I found that this might work for you:

RewriteCond %{QUERY_STRING} ^(gclid=)(.*)
RewriteRule ^(.*)$ http://www.mytracker.com/s1=test&s2=%2?

The RewriteCond tests for the presence of the gclid name in the query string as the first parameter. If that's not the case for your site, you'll need to adjust that. The ^ means the beginning of the text. The parentheses set up values for %1 and %2.

The question mark at the end of the RewriteRule suppresses the query string from being appended to the URL. This part ^(.*) of the RewriteRule says replace all characters with the following string.

Have fun with it,

Pete
petebardo -- Deadhead doing AdWords

Re: Passing gclid in URL

[ Edited ]
Follower ✭ ✭ ✭
# 5
Follower ✭ ✭ ✭

Pete,
Thank you for researching this.

I think i should have been more clear. I am using Cake software for tracking. The gclid value needs to end up in one of the Cake's subid 1-5 fields where i can then take the ones that have converted and upload into Adwords. Since Cake is a package i do not have the ability to write code like you have suggested above.

What has worked so far with other traffic sources was to put unique click id similar to gclid using one of the below formats

www.mytracker.com/s1=test&s2={cid:}
www.mytracker.com/s1=test&s2=#uniqueclid#

I am trying to find if there is syntax which will actually make above work with gclid?

Re: Passing gclid in URL

Follower ✭ ✭ ✭
# 6
Follower ✭ ✭ ✭
Was anyone able to get passing of gclid to work in above format?

Re: Passing gclid in URL

Top Contributor
# 7
Top Contributor
Hi Eric,

If you are running your web server on Apache, the rules I suggested go in the .htaccess file in the root for your web site. It doesn't matter what software you are using, the rewrites will still work. If you're running on IIS, it's more difficult to do.

I'm afraid there's no other way to get this done.

Pete
petebardo -- Deadhead doing AdWords

Re: Passing gclid in URL

Follower ✭ ✭ ✭
# 8
Follower ✭ ✭ ✭
Thank you, Pete

The tracker is hosted by 3rd party so i have no access to .htaccess file.

I guess it is not possible to get this to work in the way i would need it.
Marked as Best Answer.
Solution
Accepted by topic author Eric K
November 2015

Re: Passing gclid in URL

Top Contributor
# 9
Top Contributor
Hi Erik K,

Ok, here's another approach that might work for you if I'm understanding this correctly. Do you have a web site separate from the mytracker.com? If so, you could send the clicks to your web site, transform the URL to match Cake requirements, then forward the user to that URL.

Pete
petebardo -- Deadhead doing AdWords

Re: Passing gclid in URL

Follower ✭ ✭ ✭
# 10
Follower ✭ ✭ ✭
Hi Pete,
Great idea! Thank you so much!!!