Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1295809

    regents
    Participant

    Our Marketo tracking code isn’t working. I added it to the custom JS and Marketo tested and sent back this reply:

    “I apologize for the confusion on this. I took a closer look at the Munchkin code that was put in the page source for https://regentscapital.com/, and there is an issue with how the Munchkin code was embedded. Currently, the Munchkin code is nested within another script called “x-customizer-js”. This is causing a number of JavaScript errors, so you will want to speak to your website administrator to make sure the Munchkin code is embedded in the page by itself, and not nested within another script. Let me know if you have any questions about this.”

    Where can I put this code to make it work? Here is the code:

    <script type=”text/javascript”>
    document.write(unescape(“%3Cscript src=’//munchkin.marketo.net/munchkin.js’ type=’text/javascript’%3E%3C/script%3E”));
    </script>
    <script>Munchkin.init(‘443-BRG-414’);</script>

    #1296007

    Nabeel A
    Moderator

    Hi there,

    Thanks for writing! Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Then add the following code in your Child Theme’s functions.php:

    add_action('wp_footer','tracking_code');
    function tracking_code() { 
    ?>
    <script type="text/javascript">
    document.write(unescape("%3Cscript src='//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script>Munchkin.init('443-BRG-414');</script>
    <?php 
    }

    Let us know how this goes!