User Consent and Tracking Methods
This method is used to enable tracking of user interactions within an application. It reverses any previous tracking restrictions set by the optOut method.
📘 Good to know
This page is the method-level reference. For how opt-out fits with consent categories, erasure requests and per-SDK differences, see Protecting user data.
'optIn' Method
This method is used to enable tracking of user interactions within an application. It reverses any previous tracking restrictions set by the optOut method.
Usage example
JavaScript
intempt.optIn();
After this method is called, the application will begin to track user activities, assuming no other restrictions are in place.
Declaration
TypeScript
optIn(): void
'optOut' Method
This method disables the tracking of user interactions, ensuring that the user's actions are not monitored or recorded.
Usage example
JavaScript
intempt.optOut();
Calling this method will stop the tracking of user activities, adhering to privacy preferences or regulations.
Declaration
TypeScript
optOut(): void
'isUserOptIn' Method
This method checks whether the user has consented to tracking. It is primarily used to ensure compliance with user preferences before performing any tracking operations.
Usage example
JavaScript
if (intempt.isUserOptIn()) {
console.log("Tracking is enabled.");
} else {
console.log("Tracking is disabled.");
}
This example demonstrates how to verify if tracking is enabled before logging or collecting any data.
Declaration
TypeScript
isUserOptIn(): boolean
Returns
- Boolean: Returns true if tracking is enabled (optIn has been called), and false if tracking is disabled (optOut has been called). The default state is set to true, indicating that tracking is enabled unless explicitly disabled.
Segments
A segment is a named group of Users or Accounts that Intempt reuses as a targeting scope in Attributes, Experiences, and Journeys, built directly from the Users or Accounts list rather than a dedicated Segments page.
Why It Is Critical to Use a Single profileId Across All User Events
In customer analytics and personalization systems, maintaining a consistent `profileId` for every user across all events is essential. This ensures that both pre-identified and post-identified user...
