Hi all,
I am very much a novice with code, so any help would be much appreciated!
Issue: My UTM data from Google Ads Tracking template disappears when the visitor clicks to load a new page after the initial landing page.
Need: I need this UTM data to make it all the way to the contact page where it will be passed to my hidden fields on my form.
Current Code from contact page:
import wixLocation from 'wix-location';
$w.onReady(function () {
const { utm_source, utm_medium, utm_campaign, utm_term } = wixLocation.query;
$w("#input41").value = `${utm_source}`;
$w("#input41").hide()
$w("#input42").value = `${utm_medium}`;
$w("#input42").hide()
$w("#input43").value = `${utm_campaign}`;
$w("#input43").hide()
$w("#input44").value = `${utm_term}`;
$w("#input44").hide()
});
Current State of Work: I have a code for the contact page, but no way of retaining the UTM in the URL once the visitors leaves their landing page.
-Possible solutions: Store the query parameters and recall them on the contact page?
-Make url persist as user clicks, only changes the page with the utm data appended on each page load.
All help is much appreciated!