Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to capture if a visitor is from a google adwords click

When a user signs up on my site I want to be able to store whether or not they came to my site via an Adwords campaign.

I know google uses javascript to track conversions based on a cookie that is created on the users machine. Is there a way I can check this cookie so I can store the source against the user account?

like image 624
CeejeeB Avatar asked Mar 19 '10 15:03

CeejeeB


People also ask

Can you see who clicks on your Google Ads?

In your account statistics, you'll find the clickthrough rate (CTR), which lets you know how many people who've seen your ad end up clicking on it.

How do I know if someone has run Google Ads?

The easiest way to discover who is advertising on Google Ads is to just search for a couple of keywords and see which advertisers show up.

What is a Google click identifier?

Google Click Identifier (GCLID): Definition Google Click ID (GCLID) is a parameter passed in the URL with ad clicks, to identify the campaign and other attributes of the click associated with the ad for ad tracking and campaign attribution. In Google Ads, this is enabled by turning on the auto-tagging setting.


2 Answers

You're correct--you can read this data from the cookies.

To configure the tracking:

  1. connect your adwords and GA accounts:

  2. in your AdWords account, go to My Account > Account Preferences, click the "edit" link next to Tracking then select the box that says "Destination URL Auto-tagging". Click "Save Changes";

  3. still from your AdWords account, click the Analytics tab and choose Analytics Settings > Profile Settings > Edit Profile Information; check "Apply Cost Data", then click Save Changes

So how can you tell if it's working? And where does GA store the data?

Grab an initial __utm.gif request and look at the Referer. Appended to the URL is a new parameter "gclid." This is the keyword-specific parameter (unique to your account). It's this parameter that distinguishes your visitors as AdWord-originating (i.e., "google(cpc)") from "google(organic)" Here's one i just grabbed and anonymized (scrambled the numbers/letters):

Referer: http://www.adomainname.com/?gclid=CKr61p31yKACFZlg4wodjj3gbA

You'll see this identical string in two other places in the same tracking pixel request:

(i) as the value for the GIF Request Parameter "utmp" which is the page request for the current page, and, most importantly;

(ii) as the value for the GIF Requests Parameter "utmcc"--the container for the cookies. The specific cookie that holds the adwords data is __utmz, which is actually the container for all referral data. Here's an anonymized example i just grabbed more or less at random (i.e., i just did search in Google using a query comprised of obvious Adwords and then clicked one of the paid links in my search results, then just pulled the Request Header):

utmcc=__utma%3D755416178.1576730350.1269876846.1269143846.1269143846.1%3B%2B__utmz%3D219726107.1269143846.1.1.utmgclid%3CKr61p31yKACFZlg4wodjj3gbA%7Cutmccn%3D(not%2520set)%7Cutmcmd%3D(not%2520set)%7Cutmctr%3Dhomes%2520for%2520sale%3B HTTP/1.1

like image 121
doug Avatar answered Sep 29 '22 09:09

doug


You could add an additional url parameter to the url you gave at google adwords, and check for it on your site and store in a session variable or cookie.

At registration of a user account check for this session or cookie you have created and act accordingly..

like image 30
Gabriele Petrioli Avatar answered Sep 29 '22 10:09

Gabriele Petrioli