HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityLog In

Install and configure tracking for Profile Store

This topic describes how to install and configure tracking to Optimizely Profile Store, the Optimizely customer data platform. You can install tracking to any source.

Prerequisites

As part of the onboarding for the tracking service, Optimizely sends the required subscription keys and tracking URLs to the technical contact for your project. Use the keys to configure the tracking for your websites. Contact Optimizely for questions regarding the onboarding process.

You need Visual Studio, and the Optimizely Visual Studio extension, to install the sample site used in the example. See Installing Optimizely.

Creating a sample site with tracking

This example creates an Optimizely CMS sample site (Alloy) and adds tracking components using Visual Studio.

  1. Create a new project in Visual Studio, based on the Optimizely (Episerver) templates.
  1. Select the Alloy (MVC) sample site.
  1. When you have installed the sample site, use the Package Manager Console in Visual Studio to add Profile Store tracking.
  1. To install the main tracking package, enter install-package EPiServer.Profiles.Client at the Package Manager Console prompt (PM>), with package source set to Optimizely NuGet feed.
  1. To configure the site tracking account, open web.config, and add or modify the following in the <appSettings> section:
<add key="episerver:tracking.Enabled" value="true" />
        <add key="episerver:profiles.TrackingApiBaseUrl" value="" />
        <add key="episerver:profiles.TrackingApiSubscriptionKey" value="tracking subscription key for your profile store account" />
        <add key="episerver:profiles.ProfileStoreTrackingEnabled" value="true" />
- episerver:tracking.Enabled. Enables tracking for the base package *EPiServer.Tracking.Core*; any form of tracking on the site. This is a global Optimizely setting. Setting this to false, or removing it, stops Optimizely from tracking data to Profile Store, and other systems.
- episerver:profiles.TrackingApiBaseUrl. URL to the tracking endpoint for Profile Store. The URL is sent together with the subscription key when an account is created.
- episerver:profiles.TrackingApiSubscriptionKey. Subscription key for the tracking account. The subscription key URL is sent together with the URL when an account is created.
- episerver:profiles.ProfileStoreTrackingEnabled. Enabled tracking for *EPiServer.Profiles.Client*; from the site to Profile Store. Setting this to false, or removing it, stops Optimizely from tracking data to Profile Store.

📘

Note

Both episerver:tracking.Enabled and episerver:profiles.ProfileStoreTrackingEnabled values must be set to true to track data to Profile Store.

- episerver:tracking.IgnoreDNT. Causes the tracking system to *ignore* the DNT (DoNotTrack) header when set to true. Use this with caution to not make visitors upset.
<add key="episerver:tracking.IgnoreDNT" value="true" />

Installing CMS integration for tracking additions

The CMS integration package for Profile Store tracking contains some additions to tracking, for example scope handling. You should install this package on an Optimizely CMS site.

Enter install-package EPiServer.Tracking.Cms at the Package Manager console prompt (PM>).

Isolating tracking events and profiles in a multi-site

You can isolate tracking events and profiles using scopes.

A scope separates tracking requests to the site ID of the site where data was tracked. The default implementation for a scope when installing EPiServer.Tracking.Cms is the SiteId for the site from which the tracking event was sent. Tracking events sent from a multi-site therefore are isolated in its different sites.

You can modify this behavior by setting the scope in one of the following ways:

  • In web.config, go to the <appSettings> section, and change value of ProfileStoreTrackingEnable to true. Also, add a new key episerver:profiles.Scope.

📘

Note

Keep the scope values lowercased.

<add key="episerver:profiles.ProfileStoreTrackingEnabled" value="true" /> 
        <add key="episerver:profiles.Scope" value="defaultscope" />
  • Implement an EPiServer.Tracking.Cms.ITrackingDataInterceptor. Implementing a custom tracking data interceptor is handled in a separate article.

📘

Note

You can override the implementation for Scope in configuration file by setting episerver:profiles.Scope to the value you choose.

Tracking events from Optimizely Campaign

When using Optimizely Campaign with Visitor Intelligence , the following events can be tracked from Optimizely Campaign to Profile Store: MailingToUser, Open and Click. You can use the event data to configure filter definitions that are used to create segments.

The Optimizely Campaign events contain the following property fields:

  • EventType [string]. The type of the event.

  • Value [string]. The mailing name.

  • Scope [string]. The scope for the event. See Scopes.

  • RemoteAddress [string]. The IP address of the mailing recipient.

  • Subject [string]. The mailing name.

  • TrackID [integer]. The unique ID of the event.

  • User [object]. A property where values of the recipient are stored in the form of a JSON object.

    • email [string]. The email address of the mailing recipient.
  • Payload [object]. A property where values of the event are stored in the form of a JSON object.

  • DeviceId [string]. The user ID; the email address of the mailing recipient.

  • PageUri [string]. The URL of the online version of the mailing.

  • PageTitle [string]. The mailing name and optionally the mailing description.

  • EventTime [string]. The date and time, in UTC, when the event occurred.

Click event example

{
      "eventType"     : "epiCampaignClick",
      "deviceId"      : "[email protected]",
      "pageUri"       : "http://www.example.com/newsletter",
      "pageTitle"     : "Newsletter",
      "eventTime"     : "2020-02-20T10:10:47Z",
      "payload"       : {},
      "trackId"       : 123456702116,
      "remoteAddress" : "0.0.0.0",
      "user"          : {
                          "email" : "[email protected]" 
                        },
      "subject"       : "Newsletter",
      "scope"         : "default",
      "value"         : "Newsletter"
    }

Did this page help you?