Getting Started with the Tracking and Consent JavaScript API

To get started, add Pardot analytics to your site. This snippet adds Pardot 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 Pardot analytics on.

Set the piDomain to a verified Pardot tracker domain in your account. This tracker domain must be a subdomain of the tracked page. For example, adding the snippet to must use a piDomain with the root domain of

The Pardot analytics javascript library is loaded asynchronously and establishes an empty analytics action queue if one doesn’t exist.

Next, add some analytics actions to be processed after the library has loaded. Create an analytics tracker, and send a page view to Pardot. When a visitor views the page, a tracked page view is sent to Pardot. If the page visitor is in a geo that requires consent as defined in your Pardot 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 Pardot 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 Pardot analytics.