Google Adwords Auto-Tagging and URL Redirects: Pass "Gclid"

To pass the gclid or not to pass the gclid, that’s the question? Adwords auto-tagging (the “gclid”) makes it possible for you to see Adwords information in your Google Analytics reports without manually tagging each keyword. You simply enable auto-tagging in your Adwords account. The auto-tagging option is located on the My Account tab, on the […]

To pass the gclid or not to pass the gclid, that’s the question? Adwords auto-tagging (the “gclid”) makes it possible for you to see Adwords information in your Google Analytics reports without manually tagging each keyword.

You simply enable auto-tagging in your Adwords account. The auto-tagging option is located on the My Account tab, on the Account Preferences page. If you select this option, Adwords automatically appends a “gclid” parameter to your destination URLs:

www.example.com/?gclid=123xyz

If you already have query parameters in your URL, it will look something like this:

www.example.com/?param=a&gclid=123xyz

Note that in the first example, “gclid” is preceded by a “?” and in the second example, it is preceded by a “&”. Remember this distinction because it will be important later on.

What if you're also using a third-party tracking system such as DoubleClick, or your destination URL redirects to a second or even third URL before Adwords users arrive on your site? Will the gclid be retained or get slain?

That depends on the tracking system or behavior of your redirects. This is a very important question to address before you enable auto-tagging.

Some redirects strip the gclid. While Google Analytics still records the visit and the subsequent user activity, it doesn't have the information necessary to properly attribute the visit to your Google ad. As a result, some of this traffic will be included in the “direct” category while other visits may show up as “not set”. Furthermore, your Adwords Campaigns report in Google Analytics may show cost metrics, but your visits columns may show zeros (click image to enlarge):

If this is happening to you, you have two options:

  • Ask your site administrator to configure their servers to pass the glid
  • Manually tag your Adwords

So how do you figure out if you're passing the gclid?

Follow these steps:

Scenario 1: If your destination URL has no query parameters and looks something like this: www.i_will_redirect_you.com/:

  1. Paste this URL in your browser's address bar, but before you press Enter, append “?gclid=test” to the end, like this: www.i_will_redirect_you.com/?gclid=test.
  2. Now press Enter.
  3. If the gclid is present on the final landing page URL, you're golden.

Scenario 2: If your destination URL already has query parameters and looks something like this: www.i_will_redirect_you.com/?param=a&param2=b:

  1. Paste this URL in your browser's address bar and before pressing Enter, append “&gclid=test” to the end, like this: www.i_will_redirect_you.com/?param=a&param2=b&gclid=test.

    (This is why the “?” and the “&” distinction were important to note earlier. It's a matter of URL syntax. Luckily, auto-tagging knows the difference.)

  2. 2. Press Enter.
  3. If the gclid is still there, you're in good shape, and need only to enable auto-tagging.

Source:→ Google Analytics Blog