Form Attribution Tracking
Track the complete customer journey from first click to conversion with referral and Google Ads attribution data captured in your WordPress forms. Overview Form Attribution Tracking is a WordPress plugin that automatically captures and stores complete attribution data from Google Ads campaigns (and other traffic sources) directly in form submissions. This enables you to connect specific leads back to their originating campaigns, keywords, and ads in Google Ads for accurate conversion tracking and ROI measurement. The plugin uses first-touch attribution, meaning it captures the visitor’s original traffic source on their first visit and maintains that data through their entire journey until they convert via a form submission. Key Features Complete Google Ads Attribution Data Automatically captures 8 attribution fields for every form submission: Attribution Source – Traffic source (google, facebook, direct, etc.) Attribution Medium – Traffic medium (cpc, organic, referral, etc.) Attribution Campaign – Campaign name from utm_campaign Attribution Term – Keyword from utm_term Attribution Content – Ad variation from utm_content Google Click ID (GCLID) – Direct link to the specific Google Ads click Landing Page – The first page the visitor landed on First Click Timestamp – When the visitor first arrived Google Ads Conversion Tracking The Google Click ID (GCLID) field enables you to: – Import conversions directly back into Google Ads – Connect form submissions to specific ad clicks – Measure true campaign ROI based on actual leads/sales – Track the complete path from ad click to conversion – Attribute conversions to the exact keyword and ad that drove them Smart Tracking Technology First-Touch Attribution – Captures original source, not last-click Cookie Persistence – Maintains attribution data across multiple sessions (configurable 1-365 days) JavaScript + PHP Fallback – Dual-layer tracking ensures data capture even if JavaScript is disabled Dynamic Form Support – Mutation observer watches for forms loaded via AJAX UTM Parameter Detection – Automatically parses and stores all UTM parameters Intelligent Source Categorization – Recognizes and categorizes traffic from Google, Facebook, LinkedIn, and 15+ other platforms Universal Form Plugin Support Works seamlessly with: – Gravity Forms – Fluent Forms – Formidable Forms Modular architecture makes it easy to extend to other form plugins. Comprehensive Admin Dashboard Statistics Dashboard – View submission counts, attribution source distribution, and recent activity Form Management – See which forms have attribution tracking and bulk-add fields to all forms Debug Mode – Browser console logging for troubleshooting Flexible Configuration – Customize cookie duration and auto-add behavior How It Works Data Capture Flow Visitor Arrives – When someone visits your site, the JavaScript tracking code immediately captures: All UTM parameters from the URL Google Click ID (GCLID) if present HTTP referrer to determine traffic source Current page URL as landing page Current timestamp Attribution Stored – All data is packaged as JSON and stored in a first-party cookie with your configured expiration (default 30 days) First-Touch Persistence – If the visitor returns multiple times before converting, the original attribution data is preserved (not overwritten) Form Submission – When the visitor fills out a form, the tracking code automatically: Reads the stored attribution data Populates hidden fields in the form Submits with the complete attribution chain PHP Fallback – If JavaScript fails to populate fields, the PHP integration captures attribution server-side before form processing Integration with Google Ads To enable conversion imports in Google Ads: Forms will capture the GCLID parameter automatically from your ad URLs Export your form submissions (including attribution fields) as CSV In Google Ads, navigate to Tools → Conversions → Uploads Create a conversion action using the GCLID field to match conversions Upload your leads with timestamps and GCLIDs Google Ads will attribute the conversions to the exact campaigns, ad groups, keywords, and ads that generated them This creates a closed feedback loop between your ad spend and actual business results. Configuration Settings Access settings via Form Attribution Tracking → Settings: Auto-add to new forms – Automatically adds all 8 attribution fields when new forms are created Cookie Duration – How long to preserve first-touch attribution data (1-365 days, default 30) Debug Mode – Enables detailed logging in browser console for troubleshooting Managing Existing Forms Use the Manage Forms tab to: – View all forms and their attribution tracking status – Bulk-add attribution fields to all existing forms with one click – See which forms already have tracking enabled Statistics The Statistics tab provides: – Total submissions tracked across all forms – Breakdown of traffic sources (Google, Facebook, Direct, etc.) – Recent form submissions with their attribution data – Forms-with-tracking count Usage For Marketers Once installed and configured, the plugin works automatically. Every form submission will include complete attribution data that you can: Export to CSV and upload to Google Ads for conversion tracking Analyze in your CRM to understand which campaigns drive the best leads Use to calculate true cost-per-lead and ROI by campaign Review to optimize your landing pages and ad targeting For Developers JavaScript API The plugin exposes a global API for programmatic access: `javascript // Get full attribution data object const attribution = window.FormAttributionTracking.getAttributionData(); // Returns: { utm_source, utm_medium, utm_campaign, utm_term, utm_content, gclid, landing_page, timestamp } // Get just the traffic source (legacy method) const source = window.FormAttributionTracking.getReferralSource(); // Manually trigger form field population window.FormAttributionTracking.populateFormFields(); // Access configuration const config = window.FormAttributionTracking.config; ` JavaScript Events Listen for when attribution data is populated: `javascript window.addEventListener(‘attributionDataPopulated’, function(event) { console.log(‘Attribution captured:’, event.detail.attribution); console.log(‘Fields populated:’, event.detail.fieldsCount); }); ` PHP Hooks and Filters Extend or customize the plugin: `php // Add custom form plugin integration add_filter(‘attribution_tracking_integrations’, function($integrations) { $integrations[‘CustomForms’] = new CustomFormsIntegration(); return $integrations; }); // React to integration initialization add_action(‘attribution_tracking_integration_initialized’, function($integration_name) { error_log(“Attribution tracking initialized for: ” . $integration_name); }); // Hook into debug logging add_action(‘form_referral_source_debug_log’, function($message, $context, $source) { error_log(“[$source] $message: ” . print_r($context, true)); }, 10, 3); ` Attribution Field Names The plugin creates these hidden fields in your forms: attribution_source – Traffic source identifier attribution_medium – Marketing medium attribution_campaign – Campaign name attribution_term – Keyword/search term attribution_content – Ad content variation attribution_gclid – Google Ads Click ID attribution_landing_page – First page visited attribution_timestamp – ISO 8601 timestamp of first visit All fields are automatically populated by JavaScript and have PHP fallbacks. Traffic Source Detection The plugin intelligently categorizes traffic sources: UTM Parameters (Highest Priority) If UTM parameters are present in the URL, they are captured exactly as provided. Known Platforms (Automatic Categorization) The plugin recognizes and categorizes referrers from: – Google (google.com, google.co.uk, etc.) – Facebook (facebook.com, fb.com, m.facebook.com) – Twitter/X (twitter.com, x.com, t.co) – LinkedIn (linkedin.com, lnkd.in) – YouTube (youtube.com, youtu.be) – Instagram (instagram.com) – TikTok (tiktok.com) – Pinterest (pinterest.com, pin.it) – Reddit (reddit.com) – Bing (bing.com) – Yahoo (yahoo.com) – DuckDuckGo (duckduckgo.com) Generic Referrals For unlisted referrers, the clean hostname is stored (e.g., “example.com”) Direct Traffic When no referrer or UTM parameters are present, traffic is marked as “direct” Troubleshooting Attribution Data Not Being Captured Enable Debug Mode in plugin settings Open browser console (F12) and check for “[Referral Source]” log messages Verify cookies are enabled in the browser Check that JavaScript is not being blocked Fields Not Populating in Forms Enable Debug Mode and check console for “Field populated” messages Verify the form fields exist (check Manage Forms tab) Test with a fresh browser/incognito window Check that the form HTML includes the expected hidden field names Forms Not Showing in Dashboard Verify your form plugin (Gravity Forms, Fluent Forms, or Formidable Forms) is active Check that you have forms created in that plugin Look for PHP errors in debug.log if WP_DEBUG is enabled GCLID Not Being Captured Verify your Google Ads URLs include the {gclid} parameter Use Google’s Campaign URL Builder to test: https://ga-dev-tools.google/campaign-url-builder/ Check that cookies are working (GCLID is stored in the attribution cookie) Enable Debug Mode to see what parameters are being captured Extending the Plugin Adding Support for Other Form Plugins Create a new integration class: `php <?php namespace FormAttributionTracking\Integrations; use FormAttributionTracking\Abstracts\AbstractFormIntegration; class CustomFormPluginIntegration extends AbstractFormIntegration { public function isAvailable(): bool { return class_exists(‘CustomFormPlugin’); } public function getName(): string { return 'Custom Form Plugin'; } public function getVersion(): string { return '1.0.0'; } protected function registerHooks(): void { // Hook into your form plugin's save/render events add_action('custom_form_save', [$this, 'onFormSaved'], 10, 2); } public function addReferralSourceField(int $formId): bool { // Implement logic to add hidden fields to forms } public function removeReferralSourceField(int $formId): bool { // Implement logic to remove hidden fields } public function hasReferralSourceField(int $formId): bool { // Check if form has attribution fields } public function getAllForms(): array { // Return array of all forms } } ` Register your integration: `php add_filter(‘attribution_tracking_integrations’, function($integrations) { $integrations[‘CustomFormPlugin’] = new CustomFormPluginIntegration(); return $integrations; }); ` Architecture The plugin uses a clean, modern PHP 8+ architecture: ` src/ ├── Contracts/ │ └── FormIntegrationInterface.php # Interface all integrations must implement ├── Abstracts/ │ └── AbstractFormIntegration.php # Base class with common functionality ├── Integrations/ │ ├── GravityFormsIntegration.php # Gravity Forms support │ ├── FluentFormsIntegration.php # Fluent Forms support │ └── FormidableFormsIntegration.php # Formidable Forms support ├── Views/ │ └── admin-page.php # Admin dashboard template └── Plugin.php # Main plugin orchestration class ` Privacy & Compliance This plugin stores first-party cookies to maintain attribution data. Consider these compliance aspects: Cookie Duration: Configurable 1-365 days (default 30) Data Stored: Marketing attribution data only (no PII) First-Party Cookies: Data stays on your domain User Control: Respects browser cookie settings GDPR: Consider adding cookie consent notices per your requirements Data Retention: Attribution data is only stored in form submissions per your form plugin’s data retention policies Support & Contributing For bug reports, feature requests, or contributions: Plugin Author: Ryan Howard Website: https://www.ryanhoward.dev Text Domain: form-attribution-tracking License This plugin is licensed under the GPL v2 or later.
Top keywords
- attribution52×3.27%
- form30×1.89%
- forms29×1.82%
- google25×1.57%
- data23×1.45%
- php18×1.13%
- source17×1.07%
- ads16×1.01%
- com16×1.01%
- tracking16×1.01%
- attribution data15×0.94%
- fields15×0.94%
WPForms – AI Form Builder for WordPress – Contact Forms, Payment Forms, Survey Form, Quiz & More
WordPress Contact Form Builder Plugin WPForms is an AI drag & drop WordPress form builder that’s EASY and POWERFUL. Create contact forms, feedback forms, subscription forms, payment forms (including Stripe, Square & PayPal), and other types of forms for your site in minutes with just a few clicks! At WPForms, user experience is our #1 priority. Our pre-built form templates and workflows make WPForms the most beginner-friendly contact form plugin on the market. You don’t have to hire a developer. Create a form in less than 5 minutes with our drag & drop form builder, using a template or just asking AI to get a head start. WPForms Pro This plugin is the Lite version of WPForms Pro, which comes with email subscription forms, multi-page contact forms, file uploads, conditional logic, and extra payment integrations. Click here to purchase the best premium WordPress contact form plugin now! AI-Powered Drag & Drop Contact Form Builder Create custom contact forms in minutes with our easy-to-use drag and drop online form builder or just ask AI to build it for you. But don’t just take our word for it. See what WordPress experts are saying: WPForms is by far the easiest form plugin to use. My clients love WPForms and it’s one of the few plugins they can use without any training. As a developer I appreciate how fast, modern, clean and extensible it is. Bill Erickson – Expert WordPress Consultant Pre-built Form Templates WPForms comes with 2100+ pre-built form templates. Whether you’re looking to create a simple contact form, marketing form, request a quote form, donation form, payment order form, registration form, survey form, quiz form, Stripe payment form, or a subscription form, we have a form template already prepared and ready to use. Mobile Ready, SEO Friendly, and Optimized for Speed WPForms contact forms are 100% responsive and mobile-friendly. We optimized every query on the frontend and the backend to ensure that it’s one of the fastest WordPress contact form plugins. You can embed your contact form on any page with an optimized title and description, so WPForms is one of the most SEO friendly contact form plugins too. Fields & Features You Need to Succeed With star ratings, file uploads, repeater fields, survey fields, and multi-page contact forms, you can easily build the right custom form for your site’s needs. Plus, integrate your contact forms with an email marketing service in just a few steps and collect payments with Stripe, PayPal, and Square for bookings and orders without the need for a dedicated eCommerce plugin. See what one business owner has to say about their WPForms contact form: As a business owner, time is my most valuable asset. WPForms allows me to create smart contact forms with just a few clicks. With their pre-built form templates and the drag & drop builder, I can create a new form that works in less than 2 minutes without writing a single line of code. Well worth the investment. David Henzel – Co-founder of MaxCDN Surveys & Polls Create custom survey forms like Survey Monkey. Our WordPress survey plugin addon comes with smart survey fields including Likert scale, star ratings, and NPS. Embed your surveys and polls anywhere in WordPress. Use our survey reporting tools to customize graphs, export them for presentations, and display aggregate results. You can also share poll results instantly when collecting votes. Default WordPress Forms Aside from building simple contact forms, WPForms also helps you create better default WordPress forms, like custom WordPress login forms and custom WordPress user registration forms. Create a password-protected contact form or even a members-only contact form. Bloggers and publishers can use our WordPress post submission forms to accept guest posts, testimonials, and more. Payment Forms, Donation Forms, Booking Forms, and More While WPForms started out as a contact form plugin, it has evolved into a powerful custom forms solution for any type of payment or booking form. WPForms integrates with PayPal, Stripe, Square Payments, Authorize.Net, and Mercado Pago so you can easily accept credit card payments or take payments via PayPal. Bonus: you can also take signatures. We’re proud to be a Stripe Verified Partner. This partnership allows us to build the best Stripe integration with early access to features. You can use our Stripe integration to accept both one-time payments as well as recurring payments while syncing all form data to your Stripe account. Custom Calculator Forms Using the WPForms Calculations addon, you can build custom formulas and display results on the frontend. Create simple arithmetic calculations or build complex conditional calculations with rounded values, averages, time ranges, and more! It’s the best calculator plugin for WordPress. Forms Optimized for Conversions With our Form Pages addon, you can create distraction-free custom form landing pages to increase conversions. To improve form completion rates, we created Conversational Forms which helps you make your feedback forms feel more human by adding an interactive layout. (See Conversational Forms Demo). Easy to Customize and Extend You can easily customize your contact forms with our section dividers, HTML blocks, and CSS. Embedding forms in Elementor and Divi has never been easier thanks to our native integrations. We also know that our developer friends may want more control, so we added tons of hooks and filters. Full WPForms Feature List Online form builder – powerful drag & drop contact form builder. Create WordPress contact forms, payment forms, and other online forms without writing any code. 100% mobile responsive. GDPR friendly. Payment Forms – Take payments, donations, down payments, recurring payments, service payments with our Stripe (FREE) integration. Form templates pre-built and ready to import. Form styling for fields, labels, and buttons. Spam protection built in, plus integrations with hCaptcha, Google reCAPTCHA, and Cloudflare Turnstile. AI Forms to automatically create and refine forms through natural conversation. Instant form notifications via email. Custom form confirmations with success messages or thank you pages. Smart phone field that adapts to your visitor’s location. AI Choices to automatically populate Multiple Choice, Checkboxes, and Dropdown field options. Coupons for free shipping and sale discounts. Calculator forms for payment, shipping, billing, and more. File upload fields for user submissions. Multi-page forms with progress bars. Smart conditional logic to show or hide fields. Repeater field that enables the person filling out the form to easily add another field or group of fields to fill out. Perfect for group registration forms, custom order forms, and more. Signatures for agreements or payment forms. User registration forms and custom login forms. Post submission forms to collect user-generated content. Geolocation to collect location data along with submissions. Surveys and Polls with interactive reports. Quizzes with graded tests, personality quizzes, and scored assessments, plus AI-generated questions. Form abandonment detection to collect partial form submissions. Form locker to control access using passwords, dates, and more. Offline forms to collect submissions without an internet connection. Form landing pages to boost conversions. Conversational forms to boost overall completion rates. Lead forms to get more submissions with multi-step layouts. Webhooks to send data without third party connectors. User Journey reports so you know which content is driving form conversions. Save and Resume to let visitors save and come back later. Entry Automation to export and delete form entries on a daily, weekly, or monthly basis. Integrations Google Sheets Zapier PayPal Commerce Stripe – We’re a Stripe Verified Partner for Payments. Square Authorize.Net Mercado Pago Mailchimp AWeber Campaign Monitor GetResponse Constant Contact Airtable Notion Drip ActiveCampaign HubSpot Brevo MailerLite MailPoet ConvertKit Klaviyo SendGrid Salesforce Slack Dropbox Google Calendar Google Drive Twilio Pipedrive Make Zoho CRM You can see why WPForms is the best WordPress contact form plugin on the market! Want to unlock these features? Upgrade to our Pro version. Credits This plugin is created by Syed Balkhi. Branding Guidelines WPForms® is a registered trademark of WPForms LLC. When writing about the contact form plugin by WPForms, please make sure to uppercase the initial 3 letters. WPForms (correct) WP Forms (incorrect) wpforms (incorrect) wpform (incorrect) Notes WPForms is absolutely, positively the most beginner-friendly WordPress contact form plugin on the market. It is both easy and powerful. We took the pain out of creating online forms and made it easy. Check out all WPForms features. Also, I’m the founder of WPBeginner, the largest WordPress resource site for beginners. It was a huge priority for me to make a WordPress contact form plugin that beginners can use without any training. I feel that we have done that here. I hope you enjoy using WPForms. Thank you, Syed Balkhi