FXM JavaScript API

Last updated Monday, January 15, 2018 in Sitecore Experience Platform for Administrator, Developer

Sitecore Federate Experience Manager (FXM) offers a JavaScript API that enables you to manage some of the Sitecore analytics functionality on webpages on external websites. To use this API, you must set up the FXM JavaScript beacon on the external website.

trackEvent

Use the trackEvent function to trigger a Sitecore page event from a webpage on the external website:

  • To trigger the Page visited page event:

    SCBeacon.trackEvent(“Page visited”)

  • To trigger the page event with additional parameters, such as data and dataKey:

    SCBeacon.trackEvent(“Page visited”, { data: “custom data”, dataKey: “custom data key” })

trackGoal

Use the trackGoal function to trigger a Sitecore goal from a webpage on an external website:

  • To trigger the Register goal:

    SCBeacon.trackGoal(“Register”)

  • To trigger a goal with additional parameters, such as data and dataKey:

    SCBeacon.trackGoal(“Register”, { data: “custom data”, dataKey: “custom data key” })

Send feedback about the documentation to docsite@sitecore.net.