SEO, AdWords, affiliates, advertising, and promotions
Hello everyone,
I'm looking for help integrating a hidden form field in Shopify's native contact forms to track a customer's GCLID/Wbraid. The goal is to use this information to upload offline conversions to our Google Ads account.
Here's the customer journey: A customer clicks on an ad, interacts with our website, and fills out a basic contact form. Shopify then emails these form submissions to our company email. We continue interacting with the customer through this email thread until the sale is completed offline.
To track conversions accurately, I need a way to include a hidden form field that captures the customer's click ID and ensures it is sent to us via email when the form is submitted. However, I'm having trouble implementing this.
Has anyone managed to successfully add such a hidden field and have it included in the email notification? Any advice or solutions would be greatly appreciated!
Thank you!
Hi @asandeep
To integrate a hidden form field in Shopify's native contact forms for tracking GCLID/Wbraid, follow these steps:
1-Add Hidden Field to Contact Form:
<input type="hidden" id="gclid_field" name="gclid_field" value="">
2-Capture GCLID Using Javascript:
document.addEventListener("DOMContentLoaded", function() {
let gclid = new URLSearchParams(window.location.search).get('gclid');
if (gclid) {
document.getElementById('gclid_field').value = gclid;
localStorage.setItem('gclid', gclid); // Store GCLID for later
} else {
let storedGclid = localStorage.getItem('gclid');
if (storedGclid) {
document.getElementById('gclid_field').value = storedGclid;
}
}
});
3-Email Notification:
Note: Test thoroughly to verify GCLID appears in form submissions and email notifications.
This approach allows tracking customer clicks accurately and sending the GCLID to your company email for offline conversion uploads.
I hope my answer is helpful 🙂
Best regards,
Daisy
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024