Adding Cyan Stats to your website or web app is super easy. Simply add the code snippet bellow to the <head>
tag from your website or web application.
<script async src="<https://cyanstats.com/cs.js>"></script>
<aside> ☝ Cyan Stats will track incoming data from, and only from, registered websites/ apps.
</aside>
If your website/ web app is using Server Side Rendering (SSR), you might wanna have a look on how to embed Cyan Stats in a SSR website or web application.
All page visits are automatically tracked, no matter if it’s a traditional website, an SPA, or PWA. Events are easily tracked as well, both with simple HTML attributes or programmatically.
If you want to automatically track the page scrolling, Cyan Stats get you covered. Add the data-scroll
attribute to the script tag, and it will start logging scroll events.
<script async data-scroll="on" src="<https://cyanstats.com/cs.js>"></script>
In order to send traffic from a subdomain, you must add the data-token
attribute to the script tag. The token can be found in settings from your Cyan Stats dashboard.
<script async data-token="[TOKEN]" src="<https://cyanstats.com/cs.js>"></script>
<aside>
☝ Make sure to replace [TOKEN]
with the token found in settings.
</aside>