Sitecore Analytics Synchronisation
Sitecore xDB tracks some common analytics of which some can be synced to Salesforce and stored on the associated Contact/Lead. These values can be reported on and it includes - total goal score, goals reached, page visit count and profile data (profile name, profile keys and pattern cards).
Sitecore Configuration
The FuseIT agent can be registered in S4SMapping.config. Below is the code for it (it is commented out by default):
<scheduling> <!-- S4S pushes Sitecore DMS data to Salesforce at the specified interval --> <agent name="S4SUpdateAnalytics" type="FuseIT.S4S.WebToSalesforce.WebToEntity" method="BulkUpdateSitecoreAnalyticsInSalesforce" interval="00:30:00"/> </scheduling>
- The interval setting needs to be in the right format, say “12:00:00”.
- We believe Sitecore interprets interval="24:00:00" as 24 days
- When using something like interval="00:30:00", the seconds and minutes cannot be greater than 60 so "00:70:00" will not work. Instead use interval="01:10:00”.
The FuseIT agent uses the Bulk API to update analytics in Salesforce. There are a number of configuration entries in the S4SAnalytics.config file that are used in this process which are configurable.
<!-- The number of Salesforce entities per batch to process analytics. --> <setting name="S4S.Analytics.BulkUpdateAnalyticsBatchSize" value="10000"/> <!-- The number of records per batch to be sent to the Salesforce bulk API. --> <setting name="S4S.Analytics.BulkUpdateBatchSize" value="5000"/> <!-- The number of seconds to wait for all batches in the job to complete and then get the results. The bulk update will be cancelled if the specified time is exceeded although the bulk API jobs in Salesforce will keep running.If set to 0 the bulk update will wait until all batches have finished. --> <setting name="S4S.Analytics.BulkUpdateResultsWaitTime" value="1800"/>
- S4S.Analytics.BulkUpdateAnalyticsBatchSize This determines the number of Salesforce entities per batch to process analytics. For this batch size all the analytics are sent to the Bulk API to be pushed to Salesforce. The default value is 10000.
- S4S.Analytics.BulkUpdateBatchSize This determines the maximum number of record in a Salesforce Bulk API batch. The maximum value is 10000. The default value is 5000.
- S4S.Analytics.BulkUpdateResultsWaitTime This determines the amount of time, in seconds, the agent waits for the Salesforce Bulk API job to complete. If the wait time is exceeded the agent cancels the bulk update. The Salesforce Bulk API job will still continue to run until it is finished. The default value is 1800 seconds.
Note: The interval above will sync the analytics after every 24 hours, you can change this value in S4SMapping.config file. |
When data is synchronized to Salesforce the process uses a date/time in the Sitecore Content tree to determine the last time sync occurred (see image below). This is to limit the time required to undertake the sync and prevent unnecessarily updating the same data. When a sync has been completed, the date/time value is updated in the content tree.
Congratulations, you have finished installing S4S Analytics.
Next Step
Resolve xDB Contact from Salesforce Pipeline
Steps
- Content Personalisation Based on Salesforce Values
- Sitecore Analytics Synchronisation
- Sitecore Analytics Synchronisation (Sitecore 9.1 and later)