installation
to start using peasy, you should include the following script in the <head>
of your HTML. replace <website_id>
with your actual website id, which can be found in the peasy dashboard under settings:
<script src="https://cdn.peasy.so/peasy.js" data-website-id="<website_id>" async></script>
you can also use the minified version of the script by changing peasy.js the src attribute to peasy.min.js.
then go to your website and click around a few pages. these views will count as your first events and you'll see them right on the dashboard. that's it.
all page views are tracked automatically by default.
configuration
the script can be configured using the following data attributes:
data-website-id
your website Id from the peasy dashboard. this is required.
<script data-website-id="<website_id>" src="https://cdn.peasy.so/peasy.js" async></script>
data-ingest-url
a custom ingest url to use when proxying events. this is optional. see proxying through cloudflare workers for more information.
<script
data-ingest-url="<ingest_url>"
data-website-id="<website_id>"
src="https://cdn.peasy.so/peasy.js"
async
></script>
data-mask-patterns
an comma separated list of patterns to mask in URL tracking. this works by masking the parts of a URL that match the pattern. ideal for when you want to hide sensitive information contained in the url like /customer/*/order/*
. this is optional
<script
data-mask-patterns="/customer/*/order/*,/customer/*"
data-website-id="<website_id>"
src="https://cdn.peasy.so/peasy.js"
async
></script>
data-skip-patterns
an array of pages or patterns you don't want to be tracked. these can be exact page paths like /blog/article-1
or wildcard patterns like /admin/*
.
<script
data-skip-patterns="/blog,/admin/*"
data-website-id="<website_id>"
src="https://cdn.peasy.so/peasy.js"
async
></script>
data-auto-page-view
enable/disable automatic page view tracking. defaults to true
<script
data-auto-page-view="false"
data-website-id="<website_id>"
src="https://cdn.peasy.so/peasy.js"
async
></script>