siteclue-tracker
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

SiteClue Tracker script

Embedding on website

Automatic init

<script async defer src="siteclue-tracker.js"
        data-id="123456">
</script>

Manual init

<script async defer src="siteclue-tracker.js"></script>
<script>
    siteClue.init('123456');
</script>

Sending events

Events are custom interactions measured independently from the page views.

Events have a three-level naming hierarchy:

  • category
  • action
  • label

Values for all three can be any custom names.

The label is optional.

Automatic event attachment

<button data-siteclue-event="click:button/clicked/data">
    Click me
</button>

data-siteclue-event field value is built from 4 parts:

trigger:category/action[/label]

trigger is a JavaScript event name to attach the event trigger to. For example, the click value will trigger event to be sent on element mouse click.

The label part is optional.

For the click trigger, there is a shorter helper for setting the event:

<button data-siteclue-click="button/clicked/data">
    Click me
</button>

Manual event sending

siteClue.event('button', 'clicked', 'js');

Function parameters are, in order: category, action, and label.

Readme

Keywords

none

Package Sidebar

Install

npm i siteclue-tracker

Weekly Downloads

0

Version

0.1.0

License

Apache-2.0

Unpacked Size

43.3 kB

Total Files

35

Last publish

Collaborators

  • m-radzikowski