Debug

By default, the analytics script blocks sending page views and events from localhost to prevent distortion of production analytics data.

To check whether the page views and events sent from localhost appear on the dashboard, you can use debug mode.

Add the data-debug attribute to the analytics script with the domain name of your production site (e.g., example.com). This will allow events to be sent from localhost and saved under the specified domain name.

<script
  defer
  src="https://assets.onedollarstats.com/stonks.js"
  data-debug="example.com"
></script>

Enable debug mode on the One Dollar Stats website.

Now, all your debug events will be stored separately from production data.

If the data-debug attribute is added to the production site, the analytics script will compare its value with the current site’s host. If they match, the script will save events to the production data; if they do not match, it will save events to the debug data using the value of the data-debug attribute.