Managing Visitor Consent
In the Flagship SDK
, visitor consent is the permission given by a user (visitor) to allow the application to track their interactions and use their data for personalization and analytics purposes.
Visitor consent is crucial for compliance with data privacy regulations like the General Data Protection Regulation (GDPR). These regulations require businesses to obtain explicit consent from users before collecting or processing their personal data.
Flagship SDKs provide mechanisms to manage visitor consent, allowing you to control whether data is collected or not based on the user's consent status. This ensures that your application respects user privacy and complies with relevant data protection laws.
Visitor consent is required for each visitor and can be set during the visitor creation or whenever with the visitor instance.
Below are examples in different programming environments:
//... code
//Set during the visitor creation process
const visitor = Flagship.newVisitor({
visitorId: "your_visitor_id",
hasConsented: true, // set hasConsented to true
context: { isVip: true },
});
// Alternatively, use the setConsent method
visitor.setConsent(true);
Last updated
Was this helpful?