Installation

Detailed installation guide for Palace Tracker.

Basic Installation

Add the following script tag to the <head> section of your HTML:

<script 
  defer 
  src="https://cdn.palaceanalytics.com/palace-tracker.js" 
  data-website-id="your-website-id"
></script>

Replace your-website-id with the unique identifier for your website from your Palace Analytics dashboard.

Default Events

Once installed, Palace Tracker automatically sends two events per page visit with no additional configuration required:

  • pageview - fired when a visitor lands on a page
  • page_exit - fired when the visitor leaves the page

Script Attributes

The defer attribute ensures the script loads asynchronously without blocking page rendering. This is important for maintaining good page performance.

The data-website-id attribute is required and should contain your unique website identifier.

Platform-Specific Instructions

For detailed installation instructions for specific platforms (React, Next.js, Vue, WordPress, Shopify, Webflow, etc.), see the Platform Guides section.

Verification

After installation, open your browser's developer console and check for:

  • No JavaScript errors related to the tracking script
  • Network requests to your tracking endpoint
  • The window.palace object is available (check with console.log(window.palace))