2 Munchkin codes on 1 page error | Community
Skip to main content
Ariel_Sasso
New Participant
June 5, 2017
Solved

2 Munchkin codes on 1 page error

  • June 5, 2017
  • 1 reply
  • 3859 views

Howdy Ya'll,

I managed to get the javascript with both munchkin codes on the page, and it is firing correctly for one instance. The other instance is not showing any activity, or it takes an hour for it to load and I can't tell if it is my click or someone elses that registered.

Any thoughts on why it would be firing correctly on one and not the other, or why there would be a delay?

Code below

<script type="text/javascript">

(function() {

  var didInit = false;

  function initMunchkin() {

    if(didInit === false) {

      didInit = true;

      Munchkin.init('699-YLV-293', { altIds : ['986-JMD-215'] });

    }

  }

  var s = document.createElement('script');

  s.type = 'text/javascript';

  s.async = true;

  s.src = '//munchkin.marketo.net/munchkin-beta.js';

  s.onreadystatechange = function() {

    if (this.readyState == 'complete' || this.readyState == 'loaded') {

      initMunchkin();

    }

  };

  s.onload = initMunchkin;

  document.getElementsByTagName('head')[0].appendChild(s);

})();

</script>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

It's logging to both instances correctly, so I think you're just seeing instance-level delays.

1 reply

SanfordWhiteman
New Participant
June 5, 2017

Need a sample URL to observe traffic...

Ariel_Sasso
New Participant
June 5, 2017
Steven_Vanderb3
New Participant
June 5, 2017

I can see traffic being posted into both instances in the network traffic tab of the browser.  Are you sure you're looking at a record cookied on both domains?