Mixpanel

How to integrate Mixpanel with Zoho PageSense

With the Mixpanel integration, you can automatically collect all the actions on your site for each variation in your experiment running on Zoho PageSense.

To enable the integration, add the Mixpanel integration code snippet to the pages you want to track. After you set it up once, it will automatically run for all of your experiments.

Step 1: Set up PageSense

  1. In your project, click the Integrations option in the left pane of your project and enable Mixpanel.
  2. Open your experiment and select the Configurations tab. In the Integrations section, enable Mixpanel.
  3. Set up your experiment with the required configuration and launch it.

Step 2: Add the tracking code

  1. Sign into your Mixpanel account.
  2. Click the dropdown menu in the top-left corner and enter a project name to create a new project.
  3. Click the Set up now button and you will be taken to the Quick Install page. Copy the snippet provided below. 

The Mixpanel javascript snippet should look like this:

<!-- start Mixpanel --><script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,

0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");

for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);

mixpanel.init("cda7b2c03f4b1b70da158d06bbee0d78");</script><!-- end Mixpanel -->

  1. On the experiment webpage, paste the following line of code under the Zoho PageSense code snippet.
    Underneath the previous step's code, paste the following line of code:

<script>window.ZAB.MXIntegFunc();</script>

  1. Verify whether the data is being received from the webpages by clicking the Check button in the bottom-right corner.

The entire script should look like this:

<script src='https://d2x98wp00fzbc2.cloudfront.net/js/XXXXX/*********************.js'/><script>

<!-- start Mixpanel --><script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,

0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");

for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);

mixpanel.init("XX000");</script><!-- end Mixpanel -->

<script>window.ZAB.MXIntegFunc();</script>

Step 3: Viewing reports

  1. Create a funnel by clicking on Set up tracking in the login dropdown menu on the top right corner.
  2. Choose the Web option and enter the experiment webpage URL in the Choose a page to start tracking events dialog box. Click Go to begin tracking.
  3. In the left pane, click on the Build a Funnel option. Select the events you wish to track and save the funnel.  

Upon launching your Zoho PageSense experiment, you will be able to view all of the tracked metrics via Mixpanel in the funnel report. 

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohopagesense.com