TaskNegar فارسی

Site Metrics guide

See where people arrive, which actions they complete, and how key numbers change over time.

Send your first event

  1. Enable Site Metrics for the project. In project settings, open Sites and add your website or app.
  2. Allow your website's origin and copy the browser key and server key from the site's setup wizard.
  3. Copy the browser snippet into your site to collect pageviews. Use the script URL from the wizard for self-hosted instances.
<script src="https://app.tasknegar.ir/tn.js"
  data-key="YOUR_BROWSER_KEY" defer></script>

The browser key can be public. Keep the server key in your server's environment or secret store.

Set TASKNEGAR_METRICS_SERVER_KEY on your server, then send a sample event and a daily snapshot.

curl --fail-with-body https://app.tasknegar.ir/api/metrics/ingest \
  -H "Authorization: Bearer $TASKNEGAR_METRICS_SERVER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"events":[{"name":"project_published"}]}'

curl --fail-with-body https://app.tasknegar.ir/api/metrics/gauge \
  -H "Authorization: Bearer $TASKNEGAR_METRICS_SERVER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"active_subscriptions","value":124}'

Each request should return {"accepted":1}. Open Metrics from the project sidebar, select the site, and look for the event in Overview and the snapshot in KPI.

Send up to 50 events per request and stay within the workspace quota shown in KPI. The server key can backdate data by up to 90 days. Raw-data retention can be shorter. See the API reference for the full limits.

Read the reports

An event records something that happened. A gauge stores one reading per name and UTC day. Reporting the same gauge again replaces that day's reading.

Overview and Retention
See traffic, sessions, and active identified users. Retention shows how often identified users return. Send a stable opaque user ID on events you want to associate with a user.
Acquisition
Compare sources, mediums, and campaigns. Session conversion divides converted sessions by sessions. User conversion counts each identified user once per site and attributes them to their first session with an identified event in the selected range.
Funnels
Choose ordered events or page paths and a conversion window. Use the session and identified-user views to see where people drop out. A one-step funnel can serve as an acquisition goal.
Health
Compare web vitals and device mix. Live activity in Overview shows recent traffic.
KPI and Revenue
Track daily snapshots and revenue by currency. The all-sites view sums same-named gauges. Select one site when looking at rates, averages, or percentiles.

Choose a goal

Documentation site

Track search_performed and article_viewed. Use an ordered funnel to see how many searches lead to an article. Set article_viewed as an acquisition goal to compare campaigns. If 20 of 80 sessions convert, the session conversion rate is 25%.

SaaS app

Track signup_completed and first_project_created with the same opaque user ID. Compare the steps by identified user to see where onboarding stalls. Send active_subscriptions as a daily gauge to track the current subscriber count.