How To Find Out Which Individual Form Submissions Came From Paid Ads
- Robert Hebert
- Sep 21, 2022
- 2 min read
Who is our client and what problem did they want to solve?
Our client owns a seamless gutter installation business. For this client, we run both Google Ads and Facebook Ads. They wanted to track which traffic source was converting more leads so we implemented code in Wix to do just that.
What solution did we provide?
Whenever a visitor comes to a website from a Google Ad or a Facebook Ad, the URL that they will arrive at is formed something like this: https://websitetheyclickedtheadfor.com?gclid=XXXXXXX or https://websitetheyclickedtheadfor.com?fbclid=XXXXXXX. The part after the "?" is referred to as the query string of a URL and the gclid=XXXX or fbclid=XXXX means Google click ID equals XXXX or Facebook click ID equals XXXX.
Knowing this, we implemented code using the 'wixLocation' API to analyze the query whenever a visitor arrived on the site. If a Facebook or Google Click ID was present in the query string, we would use the 'wix-storage' API to record the value of their click ID in the browser's Local Storage and see whether it was a Google Click ID or Facebook Click ID.

What were the next steps?
Next, we added two fields to the forms that visitors would use and set them to 'collapsed' in the Elements panel of the Wix Editor so that they wouldn't take up space and would appear hidden but could still be accessed in the code.
After that, we wrote code to check the visitor's local storage to see if there was an entry for Google Click ID or Facebook Click ID, and if so, retrieved those entries and set the values of the form fields to the value of the entries.
This allowed us to see in the Form Submission tables which traffic source was converting more leads.
Check out the code we used below:
import { local } from 'wix-storage';
import wixLocation from 'wix-location';
$w.onReady(function () {
const query = wixLocation.query;
console.log("Query is ", query);
if (typeof query.gclid !== 'undefined') {
console.log(`Query gclid is ${query.gclid}`);
local.setItem("GCLID", `${query.gclid}`);
}
if (typeof query.fbclid !== 'undefined') {
console.log(`Query fbid is ${query.fbclid}`);
local.setItem("FBCLID", `${query.fbclid}`);
}
const gclid = local.getItem("GCLID");
const fbclid = local.getItem("FBCLID");
if (gclid) {
$w("#gclid").value = gclid;
}
if (fbclid) {
$w("#fbclid").value = fbclid;
}
});
import { local } from 'wix-storage';
$w.onReady(function () {
const gclid = local.getItem("GCLID");
const fbclid = local.getItem("FBCLID");
if (gclid) {
$w("#contactGclid").value = gclid;
}
if (fbclid) {
$w("#contactFbclid").value = fbclid;
}
});
Interested in setting up something like this for your ads? Contact us at 225-250-1888 or email robert@roberthebertmedia.com.
About our company
RHM specializes in helping businesses of all sizes and across all industries achieve their digital and web marketing needs. Whether it's designing a new website, building an app, performing custom development, or running Google Ads, our goal is to showcase how you are the best at what you do and help people connect with you. Contact us at 225-250-1888 to get started!
Backlink
Get a strong backlink to your website through text advertising exchange
الحصول على باك لينك قوى لموقعك من خلال تبادل اعلانى نصى
WhatsApp
+4917637777797
شيخ روحاني
جلب الحبيب
BERLINintim
شيخ روحاني في برلين 00491634511222
شيخ روحاني
رقم شيخ روحاني
رقم شيخ روحاني
شيخ روحاني في برلين
رقم شيخ روحاني 00491634511222
الشيخ الروحاني
شيخ روحاني سعودي
شيخ روحاني في برلين 00491634511222
BERLINintim
bestbacklinks
backlinkservices
buybacklink
BERLINintim
HurenBerlin
شيخ روحاني رقم شيخ روحاني الشيخ الروحاني جلب الحبيب شيخ روحاني شيخ روحاني مضمون جلب الحبيب BERLINintim casinoberlin BERLINintim جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب جلب الحبيب. ايات لجلب الحبيب العنيد . عظم الهدهد سريع الجلب للنساء . السحر…
LINK ILMUTOTO
LINK ILMUTOTO
LINK ILMUTOTO
LINK ILMUTOTO
ILMUTOTO
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
8ANGKAJITU
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
LINK KIENTOTO
LINK KIENTOTO
KIENTOTO
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
LINK 8KUDA4D
LINK 8KUDA4D
8KUDA4D
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot
Situs Slot