Skip to main content

For AI agents: a Markdown version of this page is at https://docs.snowplow.io/docs/sources/mobile-trackers/tracking-events/gdpr-tracking.md. The index of all documentation pages is at https://docs.snowplow.io/llms.txt, and the index for this section is at https://docs.snowplow.io/docs/cdi/llms.txt.

Track consent and GDPR with the native mobile trackers

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.

swift
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]
)

Was this page helpful?