Search code examples
google-analyticsgoogle-ads-apiuniversal-analytics

get ad content / keyword on landing page


When you link Analytics and Adwords, the Analytics report shows you all the details on visits, conversions, etc. by keyword, ad content and so on.

Is there a way to get these data and add them to a form on the website?

For example, I have a form where someone can sign up to the email list. I would like to add to the signup form a hidden field that contains the Ad Content and/or keyword of Google AdWords so I know based on which ad this person signed up.

Is there a way to do this, for example using JavaScript, after someone arrived to the landing page?

In code, this would look somewhat like this:

<html><body>
  <form>
    <input type="email" name="email" placeholder="Enter your email address" />
    <input type="hidden" name="adcontent" value="AdContent__dynamically-entered-for-each-visitor" />
    <input type="hidden" name="keyword" value="keyword__dynamically-entered-for-each-visitor" />
    <input type="submit" value="Subscribe" />
  </form>
</body></html>

Solution

  • By linking to an adwords account you will have enabled autotagging and thus you will not have campaign ("utm") parameters but a google click id (gclid). You cannot resolve this on the fly, so you cannot get the keyword for your HTML form.

    However you can set up your adwords as to use valuetrack parameters or custom parameters which are placeholders that are automatically filled in via adwords with values (works on an ad or adgroup level, so you do have to set them per ad) and might contain campaign information like keyword, matchtype, campaign name etc. These will remain in place even if you use autotagging so you can access them via query string variables and use them in your site.