Knowledge Base      


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:

For this article, we’ll use ClickFunnels as the page builder for setting up our tracking codes.

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 (which you can see above as the cmc_project value) to be your project’s name.

So, inside of ClickFunnels the code would go in the header code section like:

 




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>


For this, we’ll put it in the Footer section of the ClickFunnels page we’re using for registration:
 




Step 3 - Give your Stealth Seminar Embed code an ID

To get your embed code from Stealth Seminar, first you will need to go to the webinar you want the code for and click on the “Registration” button.

From there, you will choose the “Third-Party Templates” option to get access to the embed code. 
 


What you are looking for is the piece regarding the custom HTML in order to update the ID for this process.

This will be the lines between “<div style...” and “…/div>”.

Copy the code to your clipboard and then paste it into a note taking application (like Notepad) so you can make the necessary changes in the following steps.

 



The custom HTML portion of the embed code 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 HTML 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: 06/21/2023 10:09:53 AM
https://www.clickmagick.com/kb/?article=759