From 507cc4ec00bc04d37215328919a0ef7036689760 Mon Sep 17 00:00:00 2001 From: Shiny Date: Thu, 11 Apr 2024 11:41:53 +0800 Subject: [PATCH] Update tracker doc. Added data-domains usage example. --- website/docs/website/track-script.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/website/docs/website/track-script.md b/website/docs/website/track-script.md index e890e02..0f4cf6f 100644 --- a/website/docs/website/track-script.md +++ b/website/docs/website/track-script.md @@ -2,11 +2,11 @@ sidebar_position: 1 --- -# Track Script +# Tracker Script -## Install +## Installation -To track website events, you just need inject a simple script(<2kb) into your website. +To track website events, you just need inject a simple script(< 2 KB) into your website. the script look like below: @@ -49,3 +49,17 @@ then you can visit your tracker script with `"https:/// This is to help you avoid some ad-blockers. You do not need the `.js` suffix. It can be any path you choose, even you can use as `CUSTOM_TRACKER_SCRIPT_NAME="this/is/very/long/path"` + +## Tracking Specified Domains Only + +Generally the tracker will report all events wherever your site is running. But sometimes we need to ignore events like `localhost`. + +Tianji provides an attribute of the tracker script to do that. + +You can add `data-domains` into your script. The value should be your root domains to track. Use `,` to separate multiple domains. + +```html + +``` + +Then you can just see the events from these domains.