Skip to content

WordPress Setup

John Williams edited this page Mar 11, 2026 · 1 revision

WordPress Setup Guide

Plugin-Specific Configuration

Gravity Forms

  1. Form editor → Add field → Hidden
  2. Advanced tab → Parameter Name: gclid
  3. The script finds it via [name*="gclid"] — no additional config needed

Contact Form 7

Add to your form tag:

[hidden gclid ""]

WPForms

  1. Add field → Hidden Field
  2. Label: GCLID, Name: gclid

Elementor Forms

  1. Add widget → Form
  2. Add field → Hidden
  3. ID: gclid

Ninja Forms

  1. Form editor → Add field → Hidden
  2. Key: gclid

Deploy via GTM

  1. Copy scripts/wordpress.js
  2. GTM → Tags → Custom HTML → paste → Trigger: All Page Views
  3. The script auto-detects which plugin is rendering forms via MutationObserver

Passing to Google Ads

WordPress doesn't have a native Google Ads integration. Route GCLID data through your CRM:

  • Using Salesforce: GCLID captured in WP form → stored in Salesforce → Data Manager imports
  • Using HubSpot: GCLID captured in WP form → stored in HubSpot contact → native Google Ads integration exports
  • Manual CSV upload: Export leads with GCLID column → upload as offline conversions in Google Ads

Troubleshooting

Issue Fix
Field not populating Check field name attr matches the selector pattern
AJAX form not working MutationObserver handles this — confirm GTM tag fires on All Pages
Multi-page journey loses GCLID Confirm all pages are same domain (not subdomain)

Clone this wiki locally