DIY Connector Example with Conversion Linker
Starting the Journey - Entrance Tag
async function store_misclid() {
//CONFIG - SET YOUR CLICK/CAMPAIGN KEY NAME HERE, ie. "gclid" for Google Ads
const CLICKID_KEY_NAME = "misclid"
// Get the current URL
const currentUrl = this.getFrontendVariable('window_location_href');
// Create a URL object to easily parse query parameters
const urlObj = new URL(currentUrl);
const params = new URLSearchParams(urlObj.search);
const paramValue = params.get(CLICKID_KEY_NAME);
// If the parameter exists in the URL, store it and return it
if (paramValue !== null) {
const expirationTime = Date.now() + 30*24*60*60*1000; // 30 days exp. time
this.userStorage.write(CLICKID_KEY_NAME, paramValue, expirationTime);
return paramValue;
}
// Otherwise, read and return the value from storage
else {
const storedValue = this.userStorage.read(CLICKID_KEY_NAME);
return storedValue;
}
}Hit the Goal - Link the Conversion
Last updated
Was this helpful?
