SOLVED

2 Munchkin codes on 1 page error

Go to solution
Ariel_Sasso
Level 4

2 Munchkin codes on 1 page error

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>

Ariel Sasso
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: 2 Munchkin codes on 1 page error

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

pastedImage_0.pngpastedImage_1.png

View solution in original post

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: 2 Munchkin codes on 1 page error

Need a sample URL to observe traffic...

Ariel_Sasso
Level 4

Re: 2 Munchkin codes on 1 page error

Steven_Vanderb3
Marketo Employee

Re: 2 Munchkin codes on 1 page error

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?

Ariel_Sasso
Level 4

Re: 2 Munchkin codes on 1 page error

Thank you! Yes, I am seeing a significant delay in the time of data transfer

Ariel Sasso
SanfordWhiteman
Level 10 - Community Moderator

Re: 2 Munchkin codes on 1 page error

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

pastedImage_0.pngpastedImage_1.png

Ariel_Sasso
Level 4

Re: 2 Munchkin codes on 1 page error

Thank you, Sanford!

I am seeing an hour delay, anyway to speed this processing up?

Ariel Sasso
Steven_Vanderb3
Marketo Employee

Re: 2 Munchkin codes on 1 page error

Unless your pages get very heavy traffic (several tens of thousands of views an hour) you shouldn't see very much delay, if any.  If you are seeing delays of an hour of web activity writing to activity logs, you should submit a support ticket.