Configuration

Configure Palace Tracker using data attributes.

Available Data Attributes

Configure the tracker by adding data attributes to the script tag:

data-website-id (required)

Unique identifier for your website. This is automatically generated when a new website is added.

data-website-id="abc123"

data-auto-track

Controls automatic tracking. Set to "false" to disable auto-initialization. Default is true.

data-auto-track="false"

data-tag

Optional tag to identify different implementations or environments.

data-tag="production"

Full Configuration Example

<script 
  defer 
  src="https://cdn.palaceanalytics.com/palace-tracker.js" 
  data-website-id="abc123"
  data-auto-track="true"
  data-tag="production"
></script>

Event Payload Structure

Every event sent by Palace Tracker includes the following data:

{
  "websiteId": "your-website-id",
  "hostname": "example.com",
  "language": "en-US",
  "screenSize": "1920x1080",
  "userAgent": "Mozilla/5.0...",
  "url": "https://example.com/page",
  "referrer": "https://google.com",
  "tag": "production",
  "eventType": "button_click",
  "data": {
    // Event-specific data goes here
    "button": "signup",
    "location": "hero"
  }
}