Third-party analytics reports allow you to send experience data to any platform that can collect data from a page. Monetate writes a JavaScript variable, campaigns
, that contains the experience ID, name, and split information for any experience running on that page for that particular user.
You can send this data to analytics and data platforms such as SiteCatalyst, Mixpanel, Coremetrics, or any internal tools that your company has developed to track analytics.
Follow these steps to create a new custom third-party analytics report.
- Click the settings icon in the top navigation bar and then select Integration.
- On the Third-Party Analytics tab, take one of the following actions:
- If the account doesn't have any third-party analytics custom reports, then click SELECT for Custom Reporting.
- If the account already has a third-party analytics report, then click ADD REPORT and then, if necessary, select Custom.
- If the account doesn't have any third-party analytics custom reports, then click SELECT for Custom Reporting.
- Type the custom report's name into Title, and then input the platform-specific JavaScript into the console.
- Optionally, set Enable by default for all new experiences to YES if you want Monetate to push experience data for all new experiences to the third-party platform associated with the new report.
- Click CREATE.
The campaigns Variable
The JavaScript variable campaigns
is an array of objects that contains information about the experiences running on that page. This variable allows you to send Monetate data to your analytics or data platform. The number of indices in campaigns
is equal to the number of experiences.
Each index in the campaigns
variable contains the following information:
id
— The unique ID of the experience (for example,217022
)key
— A shortened version of the experience name appended with the experience ID (for example,A/B-Test_217022
)split
— The split name (for example,Experiment
orA-control
)
Here is an example of the data present in the campaigns
variable for a visitor who was exposed to three different experiences on the page.
Testing and Previewing the Report
The easiest way to test and preview the new custom report is to add a console log to see the experience object and use the preview option. You can also add a console log to a test experience targeted to your IP and then verify the accuracy of the integration.
Custom Report Example
This screenshot shows an example of a typical method for sending experience information to Mixpanel.
The campaigns
variable is an array of experiences active on the page. The following code snippet places that array in a variable available on the front end:
window.monetate = window.monetate || {}; window.monetate.campaigns = campaigns;
The following screenshot shows how to access the campaigns
variable in your console.
Enabling Third-Party Analytics for Standard Experiences
You can control whether Monetate pushes data to your third-party platform for standard experiences. This option can be useful if you don't want to report particular experiences to your third-party platform.
To enable or disable third-party reporting for individual experiences, click the additional options menu (...) on the Experience Editor page, and then click Third-Party Analytics.
The text in Report Label auto-populates with the name of the experience and its ID. Monetate reports this string to your third-party platform. If you want to see a specific string in your third-party platform for this specific experience, you can enter it into Report Label.
Click SAVE to close the modal.