installation
to start using peasy, you should include the following script in the <head>
of your HTML file. 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>
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 data attributes:
data-website-id: your website Id from the peasy dashboard. this is a required field.
<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 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 array 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/*']" 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>