Celebrate WordCamp Asia! - 30% OFF with coupon WC30 at checkout - Terms

How to Track Google Ads GCLID Using WS Form

The gclid (Google Click Identifier) is a unique tracking parameter automatically appended to URLs by Google Ads when auto-tagging is enabled. It serves as a key component for tracking user interactions with ads, helping advertisers link clicks on their ads to specific campaigns, ad groups, and keywords in Google Ads. By capturing and analyzing the gclid in your WordPress form, you can measure the effectiveness of their campaigns, track conversions, and optimize performance. It’s especially useful for integrating Google Ads data with analytics platforms like Google Analytics or CRM systems.

The gclid is added to URLs as a query string parameter. For example:

https://example.com/form-page?gclid=test123

It is possible to capture and store the gclid to each form submission, provided the gclid query string parameter is present in the URL of the page that your form is present on.

To do this:

  1. Add a Hidden field to your form.
  2. Edit the Hidden field by clicking the Settings  icon on the field itself.
  3. In the Default Value setting enter: #query_var("gclid")
  4. Click Save & Close.
  5. Click Publish if you want to make the changes live immediately.

The gclid query string parameter will now be stored in the hidden field for each submission provided it is present in the query string.

If you want to use the gclid value in an integration (e.g. in a Custom Mapping), you can reference the hidden field by using:

#field(123)

… where 123 is the ID of the hidden field.