Skip to main content

Ensuring compliance with Surfside Consent Tracking?

trackConsentGranted

Use the trackConsentGranted method to track a user opting into data collection. A consent document context will be attached to the event if at least the id and version arguments are supplied. The method arguments are:

NameDescriptionRequired?Type
idIdentifier for the document granting consentNoString
versionVersion of the document granting consentNoString
nameName of the document granting consentNoString
descriptionDescription of the document granting consentNoString
expiryDate-time string specifying when consent document expiresNoString
contextCustom context for the eventNoArray
tstampWhen the event occurredNoPositive integer

The expiry field specifies that the user consents to the attached documents until the date-time provided, after which the consent is no longer valid.

Tracking a consent granted event:

trackConsentGranted({
id: '1234',
version: '5',
name: 'consent_document',
description: 'a document granting consent',
expiry: '2020-11-21T08:00:00.000Z'
});

trackConsentWithdrawn

Use the trackConsentWithdrawn method to track a user withdrawing consent for data collection. A consent document context will be attached to the event if at least the id and version arguments are supplied. To specify that a user opts out of all data collection, all should be set to true.

The method arguments are:

NameDescriptionRequired?Type
allSpecifies whether all consent should be withdrawnNoString
idIdentifier for the document withdrawing consentNoString
versionVersion of the document withdrawing consentNoString
nameName of the document withdrawing consentNoString
descriptionDescription of the document withdrawing consentNoString
contextCustom context for the eventNoArray
tstampWhen the event occurredNoPositive integer

Tracking a consent withdrawn event:

trackConsentWithdrawn({
all: false,
id: '1234',
version: '5',
name: 'consent_document',
description: 'a document withdrawing consent'
});

Consent documents are stored in the context of a consent event. Each consent method adds a consent document to the event. The consent document is a custom context storing the arguments supplied to the method (in both granted and withdrawn events, this will be: id, version, name, and description). In either consent method, additional documents can be appended to the event by passing an array of consent document self-describing JSONs in the context argument.

The fields of a consent document are:

NameDescriptionRequired?Type
idIdentifier for the document withdrawing consentNoString
versionVersion of the document withdrawing consentNoString
nameName of the document withdrawing consentNoString
descriptionDescription of the document withdrawing consentNoString

As an example, trackConsentGranted will store one consent document as a custom context:

trackConsentGranted({
id: '1234',
version: '5',
name: 'consent_document',
description: 'a document granting consent',
expiry: '2020-11-21T08:00:00.000Z'
});

GDPR context

The GDPR context attaches a context with the GDPR basis for processing and the details of a related docuemnt (eg. a consent document) to all events which are fired after it is set.

It takes the following arguments:

NameDescriptionRequired?Type
basisForProcessingGDPR Basis for processingNoString
documentIdID of a GDPR basis documentNoString
documentVersionVersion of the documentNoString
documentDescriptionDescription of the documentNoString

The required basisForProcessing accepts only the following literals: consent, contract, legalObligation, vitalInterests, publicTask, legitimateInterests - in accordance with the five legal bases for processing

The GDPR context is enabled by calling the enableGdprContext method once the tracker has been initialised, for example:

enableGdprContext({
basisForProcessing: 'consent',
documentId: 'consentDoc-abc123',
documentVersion: '0.1.0',
documentDescription: 'this document describes consent basis for processing'
});