Before you get started, the Tracking and Consent API must be enabled on the account.
In Account Engagement:
- Go to Settings.
- Click Edit.
In the Account Engagement Lightning App:
- Select Account Engagement Settings.
- Click Edit.
To get started, add Account Engagement analytics to your site. This snippet adds Account Engagement analytics to your page and records a page view when the library loads. Replace the
piDomain with your specific account information. Add the snippet to any page you’d like to collect Account Engagement analytics on.
piDomain to a verified Account Engagement tracker domain in your account. This tracker domain must be a subdomain of the tracked page. For example, adding the snippet to example.com must use a
piDomain with the root domain of subdomain.example.com.
Next, add some analytics actions to be processed after the library has loaded. Create an analytics tracker, and send a page view to Account Engagement. When a visitor views the page, a tracked page view is sent to Account Engagement. If the page visitor is in a geo that requires consent as defined in your Account Engagement account settings and hasn’t yet opted in, the page view isn't recorded. Instead, the consent banner is shown.
Analytics actions are always processed in order after the Account Engagement analytics library has loaded. Additional actions are processed synchronously after the queue has been processed. See Tracking and Consent Functions for additional actions you can take with Account Engagement analytics.