Skip to content

Instantly share code, notes, and snippets.

@davidknipe
Last active October 17, 2018 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidknipe/526e3f3b6586d778ba139601b873dadb to your computer and use it in GitHub Desktop.
Save davidknipe/526e3f3b6586d778ba139601b873dadb to your computer and use it in GitHub Desktop.
public static void TrackEmailClick(HttpContextBase httpContext, EPiServer.Tracking.Core.ITrackingService trackingService)
{
try
{
var email = GetCurrentUserEmail();
// If you know the users name and/or additional information
// like company name it's also possible to associate here
var userData = new UserData() { Name = email, Email = email };
var trackingData = new TrackingData<object>
{
EventType = "EmailAssociated",
User = userData,
Value = "Associated email with current profile: '" + email + "'"
};
trackingService.Track(trackingData, httpContext);
}
catch
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment