ASP.NET, CMS

Integrate Sitecore Analytical Data with Salesforce

Requirement:

Display Sitecore analytic information such as Pages Visited, Duration of the Visit, Time of the Visit and Goals triggered based on email address of the website visitor and publish the same to Salesforce CRM.

page visits in Sitecore
page visits in Sitecore

Why to Save Sitecore contact’s analytical data on Salesforce?

Saving Sitecore contact’s analytical data on salesforce along with the personal information (Name, Email Address, Mobile Number) provided by the visitor helps the Sales/Marketing team in better understanding about the contact. It helps them in understanding the visitor’s behavioral pattern or product he/she is most interested in without going back to Sitecore to check Analytical data in Experience profile.

 

Problem:

Fetching analytics information of a contact from Sitecore in an API call when Sitecore.Analytics.Tracker is null.

For example, if you want to fetch and publish the analytics data when the user submits the form or trigger certain action, we can use Sitecore.Analytics.Tracker to find the current contact and get all the information about the Contact.

However, in API call or Sitecore scheduling agents Analytics.Tracker cannot be used as Analytics.Tracker returns null.

Solution:

Using default class provided by Sitecore called “Contact Repository”.

What is Contact Repository?

Contact repository is the default class provided by Sitecore that helps you perform various operations on Sitecore contacts such as Contact creation, Merge contact, load contact historical data etc.

Contact repository helps you to identify the contacts and fetch necessary information about the contact even when Analytics.Tracker is null.

Pre-requisites:
  • Reference to following dlls
  • Analytics.Tracker,
  • Analytics.Core
  • Analytics.Model
  • Install MongoDB.
  • Enable Sitecore Analytics.
  • Make sure that Salesforce account you are using have appropriate access rights to Write data to Salesforce.

 

Code:

 

Result:

As you can see below, respective page visits for the Lead/Contact selected are now shown in Salesforce. For highly engaged Sales Qualified Leads (SQL) this feature will readily help Sales person to understand the lead/customer intentions and form a contextual pitch in their interactions.

Sitecore Pagevisit information in Salesforce
Sitecore Pagevisit information in Salesforce

 

 

 

About The Author

Leave a Reply

*