For the managed package runtime, to use a third-party analytics vendor, the first step is to clone the Visualforce page for the Tracking Manager and add third-party code to it.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
- Go to Setup.
- In the Quick Find box, type visual, then click Visualforce Pages.
-
Find the Visualforce page for the Tracking Manager that you want to enable for third-party analytics tracking and click its name.
For example, you can select the VlocityTrackingManager page, Clone it, then select the name of the clone. The name of the clone must include
trackingmanager(case insensitive) as a substring. - Click Edit to open the code for the page.
-
Paste the vendor's
<script>code immediately above the<script>element already in the page.For example, if the page initially looks like this:
<apex:page sidebar="false" showHeader="false" standardStylesheets="false" showQuickActionVfHeader="false" showChat="false"> <script> //Custom Logger class to manage logsAnd the vendor's
<script>code looks like this:<script>(function(c,a) ... {batch_requests: true})</script>Then the page with the vendor's
<script>code should look like this:<apex:page sidebar="false" showHeader="false" standardStylesheets="false" showQuickActionVfHeader="false" showChat="false"> <script>(function(c,a) ... {batch_requests: true})</script> <script> //Custom Logger class to manage logs -
Find the handleOtherAnalytics function. It should look like this:
function handleOtherAnalytics(eventData){ //Support for new analytics vendor //Can be implemented by customer } -
Add code for processing the third-party analytics events.
For example, the following code is for MixPanel Analytics:
function handleOtherAnalytics(eventData){ logger.log("MixPanel Analytics Payload:"); logger.log(eventData); mixpanel.track(eventData.event, {...eventData.payload}); } - Click Save.