Data Capture
The capture process is responsible for storing tracking data.
#
Page load trackingThe capture process runs when a page is loaded. The specific mechanism used to trigger this depends on the type of site involved. See installation instructions for details.
#
Route change trackingFor sites that use client-side routing (e.g. single-page apps), the Uniform tracker must be notified that the route that has changes so it can track the new page.
Uniform provides a sample JSS app with client-side routing enabled that demonstrates how to incorporate the Uniform tracker.
#
Programmatic trackingThere are times when you need to capture visitor activity programmatically. The Uniform tracker API can be used to do this. The following code sample demonstrates how to capture a goal that is defined in Sitecore:
var data = { "id": "28a7c944-b8b6-45ad-a635-6f72e8f81f69", "name": "Instant Demo", "points": 0};var e = { type: 'goal', date: new Date(), data };var settings = { visitorId: uniform.visitor.id };uniform.tracker.event('visit-activity', e, settings);