Skip to main content

GDPR tracking

You can add an entity detailing the GDPR basis for processing to every event tracked. To configure this, provide a GdprConfiguration object when setting up a new tracker.

The only required argument is the Basis enum, which contains the six GDPR options. A document describing the legal basis for processing can also be provided (as a string), along with the document version and ID.

let gdprConfig = GDPRConfiguration(
basis: .consent, // basis for processing
documentId: "id", // document ID
documentVersion: "1.0", // document version
documentDescription: "Legal justification" // document
)

let networkConfig = NetworkConfiguration(
endpoint: "https://collector-url.com",
method: .post
)

Snowplow.createTracker(
namespace: "namespace",
network: networkConfig,
configurations: [gdprConfig]
)