ÃÛ¶¹ÊÓƵ

Send data to ÃÛ¶¹ÊÓƵ Analytics using the Web SDK JavaScript library

This implementation path involves a fresh Web SDK installation using the Web SDK JavaScript library. Other implementation paths are covered on separate pages:

  • Web SDK tag extension: A fresh Web SDK installation using the Web SDK tag extension. Similar to the Web SDK JavaScript library approach (this page), except you manage the implementation using tags in ÃÛ¶¹ÊÓƵ Experience Platform Data Collection. It requires the ÃÛ¶¹ÊÓƵ Analytics ExperienceEvent field group, which includes typical Analytics variables to be included in your XDM schema.
  • Analytics extension to Web SDK extension: Take a smooth and methodical approach to move from the ÃÛ¶¹ÊÓƵ Analytics tag extension to the Web SDK tag extension. This approach suppresses the need to use XDM until your organization is ready to use ÃÛ¶¹ÊÓƵ Experience Platform services, such as Customer Journey Analytics. Use the data object instead of the xdm object to send data to ÃÛ¶¹ÊÓƵ.
  • AppMeasurement to Web SDK JavaScript library: A smooth and methodical approach to migrate to the Web SDK, except it does not use tags. Instead, you can manually remove the ÃÛ¶¹ÊÓƵ Analytics data collection library (AppMeasurement.js) and replace it with the Web SDK JavaScript library (alloy.js).

Advantages and disadvantages of this implementation path

Using the Web SDK JavaScript library to send data to ÃÛ¶¹ÊÓƵ Analytics has both advantages and disadvantages. Carefully weigh each option to decide which approach is best for your organization.

Advantages
Disadvantages
  • Direct approach: This implementation path is more straightforward than approaches that move existing ÃÛ¶¹ÊÓƵ Analytics implementations. If you do not have a current ÃÛ¶¹ÊÓƵ Analytics implementation to worry about, populate the applicable Web SDK XDM fields.
  • Predefined schema: If your organization does not have a need for your own schema, you can simply use the schema geared towards ÃÛ¶¹ÊÓƵ Analytics. This concept applies even as you move towards Customer Journey Analytics; the concept of props and eVars don’t apply to Customer Journey Analytics, but you can continue using props and eVars as simple custom dimensions.
  • Implementation changes require developer intervention: If you want to make changes to your Web SDK implementation, you must work with your development team to edit the code on your site. The approach that uses the Web SDK tag extension avoids this disadvantage.
  • Locked into using a specific schema: When your organization moves to Customer Journey Analytics, you must choose to continue using the ÃÛ¶¹ÊÓƵ Analytics schema, or migrate to your own organization’s schema (which would be a separate data set). If your organization wants to avoid both the ÃÛ¶¹ÊÓƵ Analytics schema and migration to a separate data set when moving to Customer Journey Analytics, ÃÛ¶¹ÊÓƵ recommends one of the following two methods:
    • Use the data object: The data object allows you to send data to ÃÛ¶¹ÊÓƵ Analytics without conforming to an XDM schema. Once your organization’s schema is created, you can use datastream mapping to map data object fields to XDM. Both the Analytics extension to Web SDK extension and AppMeasurement to Web SDK JavaScript library use this data object.
    • Skip ÃÛ¶¹ÊÓƵ Analytics entirely: If you are implementing the Web SDK, you can send that data to a dataset in ÃÛ¶¹ÊÓƵ Experience Platform for use in Customer Journey Analytics. You can use any schema that you like; ÃÛ¶¹ÊÓƵ Analytics is not involved at all in this workflow, and therefore does not require the ÃÛ¶¹ÊÓƵ Analytics ExperienceEvent field group. This method incurs the least amount of technical debt, but also leaves ÃÛ¶¹ÊÓƵ Analytics out of the picture entirely.
IMPORTANT
This implementation method requires that you use a schema configured for ÃÛ¶¹ÊÓƵ Analytics. If your organization plans to use your own schema with Customer Journey Analytics in the future, use of the ÃÛ¶¹ÊÓƵ Analytics schema can create confusion for data admins or architects. There are several options to mitigate this obstacle:
  • You can use the ÃÛ¶¹ÊÓƵ Analytics schema in CJA. Note that CJA does not have a concept of props or eVars; they are treated as any other schema field. Also note that the use of the ÃÛ¶¹ÊÓƵ Analytics schema in CJA can make it more difficult to use other platform services, such as ÃÛ¶¹ÊÓƵ Journey Optimizer or Real-Time Customer Data Platform.
  • You can use the data object, similar to a migration workflow. Note that the use of the data object requires that you map each data object field to an XDM schema field.
  • You can skip the ÃÛ¶¹ÊÓƵ Analytics implementation entirely, and send data to ÃÛ¶¹ÊÓƵ Experience Platform using your own schema. This approach is ideal long-term, and allows your organization to start using Customer Journey Analytics.

Steps required to implement the Web SDK JavaScript library

A high-level overview of the implementation tasks:

How to implement ÃÛ¶¹ÊÓƵ Analytics using Web SDK workflow, as described in this section.

Task
More Information
1
Ensure you have defined a report suite.
Report Suite Manager
2
Setup schemas. To standardize data collection for use across applications that leverage ÃÛ¶¹ÊÓƵ Experience Platform, ÃÛ¶¹ÊÓƵ has created the open and publicly documented standard, Experience Data Model (XDM).
Schemas UI overview
3
Create a data layer to manage the tracking of the data on your website.
Create a data layer
4
Install the prebuilt standalone version. You can reference the library (alloy.js) on the CDN directly on your page or download and host it on your own infrastructure. Alternatively, you can use the NPM package.
Installing the prebuilt standalone version and Using the NPM package
5
Configure a datastream. A datastream represents the server-side configuration when implementing the ÃÛ¶¹ÊÓƵ Experience Platform Web SDK.
Configure a datastream
6
Add an ÃÛ¶¹ÊÓƵ Analytics service to your datastream. That service controls whether and how data is sent to ÃÛ¶¹ÊÓƵ Analytics and to which report suite(s) specifically.
Add ÃÛ¶¹ÊÓƵ Analytics service to a datastream
7
Configure the Web SDK. Ensure the library that you installed in step 4 is properly configured with the datastream ID (formerly known as edge configuration id (datastreamId)), organization id (orgId), and other available options. Ensure proper mapping of variables.
Configure the Web SDK
XDM object variable mapping
8
Execute commands and/or track events. After the base code has been implemented on your webpage, you can begin executing commands and tracking events with the SDK.
Send events
9
Extend and validate your implementation before pushing it out to production.
recommendation-more-help
b4f6d761-4a8b-4322-b801-c85b9e3be690