How do I integrate Mixpanel into a C2 game for mobile?

0 favourites
  • 5 posts
From the Asset Store
A cool way for kids to write and practice English Alphabets
  • Hi Everyone,

    I'm trying to get some good analytics in place using Mixpanel (required to work with a publisher I'm talking working with)

    the first thing they want is to have me past a big block of code that looks like this:

    <!-- start Mixpanel --><script type="text/javascript">(function(f,b){if(!b.__SV){var a,e,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.set_once people.increment people.append people.track_charge people.clear_charges people.delete_user".split(" ");

    for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=f.createElement("script");a.type="text/javascript";a.async=!0;a.src="//cdn.mxpnl.com/libs/mixpanel-2.2.min.js";e=f.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}})(document,window.mixpanel||[]);

    mixpanel.init("bla bla bla token stuff...");</script><!-- end Mixpanel -->

    since there's not HTTP: to this, i don't see how i could use ajax or websocket to pass this data.. this isn't a .js file so i'm wondering how i could maybe set this up to be in a .js file and then of course.. how the heck I could access that js file!?

    NOTE: Also I found it incredible that not one prior post about mixpanel was mentioned. Its a really nice service and does a lot of cool stuff and has a free version so it seems like a really nice solution for folks. I know there is google analtyics, but this feels a little more developed for monetization than what I've seen with GA.

    Thanks!

    Caleb

  • Browser execute javascript should work..

    But it might be better to create a custom plugin for it..

  • part12studios

    Do you have any tips for me.... im trying to set mixpanel aswell

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • i'm no longer use mixpanel and really never got that far with it when i was unfortunately. good luck

  • Hello!

    Enhance supports both Construct 2 and Mixpanel along with many other 3rd party services.

    Integration takes almost no time at all!

    For information, just follow this link : goo.gl/LUc3iD

    Good Luck!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)