How do I set up cross-device tracking using Stealth Seminar Custom Pages?
To get started with setting up cross-device tracking, please review the article below:
Step 1 - Add Your Click Tracking Code On Your Registration Page
You'll want to use the code below and add it to the
<head>
or Header section of your page builder:
<script>
window.clickmagick_cmc = {
uid: '[USERID]',
hid: '[HID]',
cmc_project: 'NameOfYourProject',
}
</script>
<script src='//cdn.clkmc.com/cmc.js'></script>
Be sure to change
NameOfYourProject
between the
'
s to be your project’s name.
Step 2 - Add the following JavaScript code to the </body>
or Footer Section of the Registration Page:
What the code below does is apply the
cmc_vid
value to the iFrame URL used by Stealth Seminar.
<script>
stealthiframe = document.getElementById('myIframe');
stealthiframe.src = stealthiframe.src + '&v1=' + clickmagick_cmc.vid;
</script>
Step 3 - Give your Stealth Seminar Embed code an ID
The embed you get from Stealth Seminar will include something like this:
<div style="width: 100%; max-width: 480px; height: 900px;"><iframe style="width: 100%; height: 100%; border: 0;"
src="https://joinnow.live/embed/s/abcdefg?layout=styled-0"></iframe></div>
You must modify the code to have the ID myIframe
So the new embed code will look like this:
<div style="width: 100%; max-width: 480px; height: 900px;"><iframe style="width: 100%; height: 100%; border: 0;"
src="https://joinnow.live/embed/s/abcdefg?layout=styled-0" id="myIframe"></iframe></div>
Step 4 - Add this code to the Bottom of Registration Page
Inside of Stealth Seminar, go to the Miscellaneous section and add the JavaScript code to the Registration Page Tracking Code box:
Use this JavaScript code below:
<script>
function getUrlParameter(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
var results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
const input = document.querySelector("input[name='customFields.cmc_vid']");
if (getUrlParameter("v1")) {
input.value = getUrlParameter("v1")
}
</script>
Once that is all done, you'll be good to go with using Cross Device Tracking.
Article 759 Last updated: 05/16/2022 7:15:11 AM
https://www.clickmagick.com/kb/?article=759