siteline Start free trial Log in

Script install

See your data

Add one deferred script. Replace the site id with the public id from SiteLine, and the origin with your SiteLine app origin or your first-party proxy origin. Set data-endpoint to an absolute collect URL so events are not posted to your own site by mistake.

<script
  defer
  data-site-id="YOUR_SITE_ID"
  data-endpoint="YOUR_SITELINE_ORIGIN/api/analytics/event"
  src="YOUR_SITELINE_ORIGIN/js/script.js"
></script>

Optional attributes, off unless you set them:

Pageviews start on load. The script does not set an analytics cookie. Hostname allowlists still apply: events from a host you did not register are rejected.

Install steps

  1. Register. The trial is 7 days and does not ask for a card. Plans start at $4.99/mo.
  2. Add the website you want to measure. Copy the public site id from the install screen. These docs write that id as YOUR_SITE_ID.
  3. Paste the deferred script above into the document. Set data-endpoint to an absolute URL on YOUR_SITELINE_ORIGIN so the browser does not post the event to the page you are measuring.
  4. Load the page once. The install screen leaves the waiting state when the first pageview arrives.
  5. Leave outbound links and file downloads off until you want those events. Each one is billable, the same as a pageview.

The script does not read a cookie and does not set one. If an ad blocker drops YOUR_SITELINE_ORIGIN, move the script and the collect URL behind a first-party proxy you operate. SiteLine does not create a CNAME for you.

Named actions use the same collect URL. Custom events keep the same limits: at most 10 property keys, 64 characters on a key, 256 on a string value. Do not put an email or an account id in a property.