Skip to main content

User Consent and Tracking Methods

Updated this week

'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.

Did this answer your question?