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:
Name | Description | Required? | Type |
---|---|---|---|
id | Identifier for the document granting consent | No | String |
version | Version of the document granting consent | No | String |
name | Name of the document granting consent | No | String |
description | Description of the document granting consent | No | String |
expiry | Date-time string specifying when consent document expires | No | String |
context | Custom context for the event | No | Array |
tstamp | When the event occurred | No | Positive 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:
Name | Description | Required? | Type |
---|---|---|---|
all | Specifies whether all consent should be withdrawn | No | String |
id | Identifier for the document withdrawing consent | No | String |
version | Version of the document withdrawing consent | No | String |
name | Name of the document withdrawing consent | No | String |
description | Description of the document withdrawing consent | No | String |
context | Custom context for the event | No | Array |
tstamp | When the event occurred | No | Positive integer |
Tracking a consent withdrawn event:
trackConsentWithdrawn({
all: false,
id: '1234',
version: '5',
name: 'consent_document',
description: 'a document withdrawing consent'
});
Consent documents
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:
Name | Description | Required? | Type |
---|---|---|---|
id | Identifier for the document withdrawing consent | No | String |
version | Version of the document withdrawing consent | No | String |
name | Name of the document withdrawing consent | No | String |
description | Description of the document withdrawing consent | No | String |
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:
Name | Description | Required? | Type |
---|---|---|---|
basisForProcessing | GDPR Basis for processing | No | String |
documentId | ID of a GDPR basis document | No | String |
documentVersion | Version of the document | No | String |
documentDescription | Description of the document | No | String |
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'
});