AI Note: We wrote two plugins that can be used in combination to handle this very common task. We then asked ChatGPT to learn about them and create a blog post summarizing how they work together! ChatGPT really loves emojis by default.
If you’re running Google Ads or any other paid campaigns, tracking UTM parameters with form submissions is crucial for measuring performance. To make this seamless in WordPress with Gravity Forms, you can use the following two plugins:
1. Store UTM Params to Cookie – Stores UTM parameters in cookies so they persist as users navigate your site.
2. GF Dynamic Population from Cookies – Reads cookies client-side and dynamically populates Gravity Forms fields using Gravity Forms’ built-in dynamic population feature.
Together, these plugins ensure UTM parameters are captured and submitted with every Gravity Forms entry—even if the user navigates away from the landing page before submitting the form.
🚀 Why This Setup Works Perfectly
✅ Handles multi-page navigation – Users can browse around before submitting the form, which Gravity Forms’s default behavior can’t handle.
✅ No caching issues – Uses JavaScript to dynamically inject values at submission time.
✅ 1-day persistence – UTM parameters are stored in cookies for 86400 seconds (1 day) to ensure tracking accuracy.
✅ 100% native Gravity Forms functionality – Uses built-in dynamic population.
🔧 Step 1: Install and Activate the Plugins
1️⃣ Install Store UTM Params to Cookie
This plugin automatically detects UTM parameters in the URL and stores them in cookies.
Installation
- Download the plugin from GitHub: store-utm-params-to-cookie
- Upload it to your WordPress site (Plugins > Add New > Upload Plugin).
- Activate it from the Plugins menu.
🔹 What It Does:
- Detects utm_source, utm_medium, utm_campaign, utm_term, and utm_content from the URL. Also supports other params starting with
utm
. - Stores them as cookies for 1 day.
- Cookies are prefixed with
sup_
to avoid collision with other plugins that may try to do something similar. Soutm_source
becomes a cookie calledsup_utm_source
.
2️⃣ Install GF Dynamic Population from Cookies
This plugin reads the stored cookies and dynamically fills in Gravity Forms fields before the user submits the form.
Installation
- Download the plugin from GitHub: gf-dynamic-population-from-cookies
- Upload it to WordPress and activate it.
🔹 What It Does:
- Reads cookies, like those set by the first plugin.
- Dynamically populates Gravity Forms fields using Gravity Forms’ built-in dynamic population feature.
📝 Step 2: Set Up Gravity Forms to Capture UTM Parameters
Now that cookies are being stored, we need to configure Gravity Forms to capture them.
1️⃣ Add Hidden Fields for UTM Parameters
- Open your Gravity Form.
- Add hidden fields for the UTM parameters you want to track:
- utm_source
- utm_medium
- utm_campaign
- utm_term
- utm_content
2️⃣ Enable Dynamic Population for Each Field
- Click on each hidden field.
- Under Advanced, check “Allow field to be populated dynamically.”
- Set the parameter name to match the UTM key with the
sup_
prefix that the first plugin adds. (e.g., sup_utm_source, sup_utm_medium, etc.).
🎯 Now, the plugin will automatically populate these fields from cookies!
🎯 Step 3: Test Your Setup
- Open your website with UTM parameters in the URL, like
https://yourwebsite.com/?utm_source=google&utm_medium=cpc&utm_campaign=spring_sale
- Navigate to a different page to demonstrate that cookies persist.
- Submit your Gravity Form and check the Entry Data (Forms > Entries).
- The UTM parameters should appear in the submitted form data!
🔗 Get the Plugins
🔥 Now you have full UTM tracking for Gravity Forms submissions! Let us know if you have any questions. 🚀
Leave a Reply