Developer Help Centre > Heap Analytics Integration

Integrating Maxymiser with Heap Analytics

Integrating with Heap Analytics allows you to allows you to attach campaign information to the Heap Analytics' visitor profile so that you can later filter your analytics by campaign experience.

This article explains how to:

  • Integrate a Maxymiser campaign with Heap Analytics

How we send the data?

This integration uses heap.addUserProperties to attach the relevant user experience to the visitor profile. The data format is unique in comparison to our other analytics integrations. Instead of passing a single string as a property of a "a/b testing" property, we set multiple properties. Each property corresponds to an element within a campaign. The format of each property is as follows:

<campaignName>-<elementName>: <variantName>

Integration Implementation

The Maxymiser integration with Heap Analytics is based on 3 separate scripts. Follow the steps described under "Configure sample integration for a campaign" heading in the Integrations Overview article to set up the integration.

  1. Integration Module (Site Script, take from Step 1);

  2. Heap Analytics register (Site Script, use for Step 2);
    // Heap Analytics integration v1.0.0 !function(){var a={version:"1.0.0",campaignRequired:!0,timeout:5e3,validate:function(a){return!0},check:function(a){return!(!window.heap||"function"!=typeof window.heap.addUserProperties)},exec:function(a){var b={},c="MM-"+a.campaign.getName(),d=a.campaignExperience.split("|"),e="",f="";return d=d.map(function(a){e=a.split(":")[0]||"",f=a.split(":")[1]||"",b[c+"-"+e]=f}),heap.addUserProperties(b),!0}};"object"==typeof modules&&"function"==typeof modules.define&&modules.require("Integrations").register("Heap Analytics",a)}();

  3. Heap Analytics initialize (Campaign Script, use for Step 3)
    Integrations.run('Heap Analytics', { campaign: campaign });