Knowledge Base      


What if my Page Builder won’t work with ClickMagick's tracking code?


With the vast majority of the Page Builders out there, you can easily add our Click Tracking or Conversion Tracking code to the <head> or <body> of your web pages.

There are, however, a couple of buggy Page Builders that need special care. For these Page Builders, we have an alternative form for our Click Tracking or Conversion Tracking code that’s uglier and longer but works exactly the same this as our normal code.

If you’ve found that your Page Builder adds Tracking or Conversion code to your page twice even though you’ve added it in just one place, or your Page Builder strips out or adds additional <script> tags, then this code is for you.


Alternative Click Tracking Code

Here is the alternative Click Tracking code that you would use for your landing page. Just copy this code and paste it into your Page Builder, then change the project name from NameOfYourProject to the actual name of your project:

<script>
    if (typeof clickmagick_cmc === 'undefined') {
        window.clickmagick_cmc = {
            uid: '[USERID]',
            hid: '[HID]',
            cmc_project: 'NameOfYourProject',
            vid_info: 'on',
        }

        ;(function(d) {
            var s = d.createElement('script');
            s.async = true;
            s.src = 'https://[CODE-DOMAIN]/[CODE-FILENAME].js';
            var fs = d.getElementsByTagName('script')[0];
            fs.parentNode.insertBefore(s, fs);
        })(document);
    }
</script>



Alternative Conversion Tracking Code

For the alternative Conversion Tracking Code, you’ll need to take the Click Tracking Code above and do a little bit of editing ...

The easiest approach is to first create the standard Conversion Tracking code for an Action, Engagement, or Sale using the Website Code Wizard, then take the alternative Click Tracking Code you see above and replace everything between these lines:

window.clickmagick_cmc = {
   ...

}

with the lines you see in the Website Code Wizard.

For example, if the Conversion Code that you see in the Website Code Wizard looks like this …

<script>
    window.clickmagick_cmc = {
        uid: '[USERID]',
        hid: '[HID]',
        cmc_project: 'NameOfYourProject',
        cmc_goal: 'a',
        cmc_ref: 'salesvideo',
     }
</script>
<script src='//[CODE-DOMAIN]/[CODE-FILENAME].js'></script>


… you would copy the lines of code between the { and } characters and replace those lines in the Click Tracking Code at the top of the page to create this new piece of Conversion Tracking Code:

<script>
    if (typeof clickmagick_cmc === 'undefined') {
        window.clickmagick_cmc = {
            uid: '[USERID]',
            hid: '[HID]',
            cmc_project: 'NameOfYourProject',
            cmc_goal: 'a',
            cmc_ref: 'salesvideo',
        }

        ;(function(d) {
            var s = d.createElement('script');
            s.async = true;
            s.src = 'https://[CODE-DOMAIN]/[CODE-FILENAME].js';
            var fs = d.getElementsByTagName('script')[0];
            fs.parentNode.insertBefore(s, fs);
        })(document);
    }
</script>


 
Caution: When you edit this code, do NOT use a word processor or a “rich text” editor that automatically replaces straight quotes with curly quotes. In other words replacing these straight quotes 'with these curly quotes  will break your code. You MUST use a “plain text” editor, or better still, just edit the code in the entry box of your Page Builder which should always work.
 

If your Page Builder automatically adds the <script> and </script> tags, or it breaks when you include them, simply remove those two lines from this alternative code when you enter the code into the Page Builder.

If you have any trouble making these edits, please submit a ticket to the Help Desk.

Article 755 Last updated: 10/15/2025 2:17:54 PM
https://www.clickmagick.com/kb/?article=755