문서
문서 둘러보기

Tracker debug mode

Use tracker debug mode to log every hit to the console without sending it, send real hits from localhost, and check the /api/event request in your dev tools.

Markdown으로 보기
html
<script defer src="https://privatusanalytics.com/js/pa.js" data-site="pa_YOURSITEID" data-debug="true"></script>

With data-debug="true" the tracker:

  • logs every hit to the browser console as [privatus] pageview {…}, with the exact request body,
  • doesn't send anything, so debugging never pollutes your data,
  • runs on localhost and file://,
  • logs why a hit wasn't sent ([privatus] not sent: opted out, …: domain not in data-domains, and so on).

Sending from a local server#

To send real hits while developing (for example, to test goals end to end on a development site), use data-allow-local="true" instead. The site's domains must include the hostname you use, e.g. localhost, or the server drops the hits. Most people create a separate "development" site for this.

Checking the network request#

In the browser's developer tools, Network tab, filter for event. Each hit is a POST to /api/event answered with 202 Accepted. See What the tracker sends for the body.