Cloud Services

TrackAny.Click — Documentation

Read as Markdown

01

Getting started

1. Create and verify one Cloud account. 2. Select or create the organization that owns the integration. 3. Create a project for the website, shop or brand whose data must stay together. 4. Open the product workspace and confirm that it is enabled before copying credentials or sending production traffic.

That is the complete account setup. The remaining sections are implementation guides. Credentials are always project-scoped; server secrets must never be placed in browser code, public repositories or client-side environment variables.

02

Before you integrate

TrackAny.Click collection is activated per customer project. Start production traffic only when the project workspace displays a public key, the installation snippet and an active collector URL. Prepared URLs or a script copied from another project do not activate collection.

03

Public and secret project keys

The public pub_tac_ key belongs in the browser and is restricted to the active domains of its project. The sec_tac_ key is shown once when the project is created and belongs only in a server-side secret manager. It authenticates server events and identify calls.

If the secret key was not stored, do not substitute the public key or expose a server key in the browser. Request a controlled replacement before integrating server events; self-service secret-key rotation is not currently available.

04

Install the browser tracker

Copy the public key and the exact script URL from TrackAny.Click → Installation. Place the script on the pages you want to measure and keep data-consent=denied until analytics consent is granted. The collector URL may be the shared connect.trackany.click host or a verified tracking domain shown in your workspace. data-spa=true records the first view and History API navigation after consent; data-track-outbound=true records external link clicks.

Choose one consent path: enable the TrackAny.Click-managed banner in the workspace and add data-consent-banner=managed, or connect your existing consent system with the consent command below. Do not show both consent dialogs.

data-web-vitals=true adds consented Core Web Vitals. The tracker can observe future Meta Pixel and Google dataLayer/gtag calls after analytics consent while leaving those tags intact; set data-provider-events=false to disable this bridge. Calls made before the tracker loads are not recovered.

<script async src="https://connect.trackany.click/v1/t.js"
  data-project="YOUR_PUBLIC_PROJECT_KEY"
  data-endpoint="https://connect.trackany.click"
  data-consent="denied"
  data-consent-banner="managed"
  data-spa="true"></script>
05

Consent and data minimization

In normal mode, before analytics consent, the tracker does not create measurement identifiers or send measurement events. The managed banner may read or save the consent choice itself. Withdrawing consent clears local visitor and session state and stops future SDK events. It does not delete events already stored by the service; use the project's data request process for that.

Keep names, email addresses, secrets and other personal information out of page paths, campaign labels and custom event properties. Page URLs lose query strings and fragments; the tracker does not fingerprint visitors.

08

Measure first actions and outcomes

Define the first meaningful action and the later business outcome as separate events. In the visitor-path report, each measured session belongs to its first configured action or to the no-action branch.

For an appointment funnel, a form lead is not a confirmed booking: send appointment_booked or appointment_created from a trusted source after the booking is confirmed in the same session. Review the report's coverage and event window before comparing paths.

09

Track page views, leads and conversions

Use lowercase snake_case event names. Mark real goals with conversion=true and pass value and a three-letter currency together when the event has a monetary value. Browser calls automatically carry the consent-bound visitor, session and attribution context.

Use one event for one business fact. Do not report the same purchase from browser and server unless both events intentionally represent different facts.

window.trackany("consent", "granted");
window.trackany("pageview");
window.trackany(
  "event",
  "form_submit",
  { form: "demo_request" },
  { conversion: true }
);
10

Browser event examples

The tracker emits page_view for automatic SPA views when data-spa=true. A manual pageview call emits the same event. With data-track-outbound=true, clicks on external HTTP(S) links emit outbound_click with destination_origin only. It creates sessions automatically but does not emit session_start by itself. The consent command changes local tracking permission; it is not an event.

The other names below are suggested conventions, not a fixed event whitelist: view_product, add_to_cart, begin_checkout, form_started and form_submit. Each window.trackany call sends one event after analytics consent. Use properties for non-sensitive IDs or counts; conversion is an event option.

window.trackany("pageview");

window.trackany("event", "view_product", { product_id: "sku_123" });
window.trackany("event", "add_to_cart", { product_id: "sku_123", quantity: 1 });
window.trackany("event", "begin_checkout", { cart_id: "cart_123" });
window.trackany("event", "form_started", { form_id: "demo" });
window.trackany("event", "form_submit", { form_id: "demo" }, { conversion: true });
window.trackany("event", "session_start");
11

Server event examples

Send confirmed business facts from your backend with a secret key: lead_created, lead_qualified, appointment_created, appointment_completed, order_created, purchase, refund, subscription_started, subscription_cancelled, deal_won and deal_lost. These are suggested names; the API also accepts your own lowercase snake_case names up to 100 characters.

The Node.js example uses the ulid package to create a valid eventId. Install that package in your server project. Keep the exact eventId and JSON body for retries. Monetary value must be non-negative and accompanied by a three-letter currency; send a refund as its own event rather than a negative purchase. Only mark genuine goals as conversions.

import { ulid } from "ulid";

const endpoint = "https://connect.trackany.click/v1/events";
const secretKey = process.env.TRACKANY_SECRET_KEY;

async function sendEvent(event, properties = {}, fields = {}) {
  const body = {
    eventId: `evt_${ulid()}`,
    event,
    timestamp: new Date().toISOString(),
    properties,
    ...fields,
  };
  const response = await fetch(endpoint, {
    method: "POST",
    headers: {
      authorization: `Bearer ${secretKey}`,
      "content-type": "application/json",
    },
    body: JSON.stringify(body),
  });
  if (!response.ok) throw new Error(`TrackAny event rejected: ${response.status}`);
  return response.json();
}

await sendEvent("lead_created", { lead_id: "lead_123" }, { contactId: "crm_123" });
await sendEvent("lead_qualified", { lead_id: "lead_123" }, { contactId: "crm_123" });
await sendEvent("appointment_created", { appointment_id: "appt_123" });
await sendEvent("appointment_completed", { appointment_id: "appt_123" });
await sendEvent("order_created", { order_id: "ord_123" });
await sendEvent("purchase", { order_id: "ord_123" },
  { value: 49.90, currency: "USD", conversion: true });
await sendEvent("refund", { order_id: "ord_123" },
  { value: 49.90, currency: "USD" });
await sendEvent("subscription_started", { subscription_id: "sub_123" });
await sendEvent("subscription_cancelled", { subscription_id: "sub_123" });
await sendEvent("deal_won", { deal_id: "deal_123" }, { conversion: true });
await sendEvent("deal_lost", { deal_id: "deal_123" });
12

Send a trusted server event

POST JSON to /v1/events with the secret key as a Bearer token. Server events can include contactId or externalId and are reported separately from browser-trust events. Keep eventId stable when retrying the same event: identical content is deduplicated, while changed content under the same ID returns HTTP 409 event_id_conflict.

curl --request POST "https://connect.trackany.click/v1/events" \
  --header "Authorization: Bearer $TRACKANY_SECRET_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "eventId": "evt_01JZ8J2K9M7P4Q6R8S1T3V5W7X",
  "event": "purchase",
  "timestamp": "2026-09-08T17:00:00Z",
  "contactId": "crm_123",
  "value": 49.9,
  "currency": "USD",
  "conversion": true,
  "properties": {
    "plan": "pro"
  }
}'
13

Link customer visits across devices

After analytics and identified-profile consent, pass window.trackany.getContext() to your own authenticated backend. Send a stable customer ID and, when available, the customer's name and email to POST /v3/identify using the secret key for that site. Derive customer fields from the authenticated account or verified order source. Browser assertions never count as verified identity.

The same verified customer ID or verified email joins consented browser histories into one customer profile within an organization, project and site. An unverified email alone creates a provisional profile and cannot claim an existing customer. Name is a display field, never a matching key. Account-ID conflicts stay separate and appear in customer-identification settings for review.

For automatic identification on selected /v2/events, send customerConsent with analytics:true, identifiedProfiles:true, decidedAt and policyVersion. Use an explicit customer object as above, or configure event names and properties paths in Persons & visitors → Connect customer identities. Login, sign_in, sign_up, complete_registration and purchase are starting event names. These choices are independent of your lead/completion funnel.

For the browser helper, call trackany.identify('/api/trackany-identity', profileConsent). Your same-origin endpoint validates the account and CSRF, adds the trusted customer and site fields, forwards the command and returns its status. Keep secret keys on your backend. Before logout or account switching, call trackany.logout with that endpoint and consent. It closes the identity and rotates local visitor/session IDs. Consent withdrawal notifies that configured endpoint with action:withdraw and clears local identifiers.

Contact fields are encrypted separately from events. Owners and administrators can view them and grant project members contact access. Search by name or exact email in Persons & visitors. The profile shows when identity became known, linked browsers and individual visits; visits before identification are included only when attribution is unambiguous. Public embeds and aggregate reports do not receive contact fields.

Choose Identified person across devices as an explicit funnel basis to count matched people. Anonymous and provisional visits remain unlinked in that basis; qualifying event occurrences still count. Existing session and observed-visitor definitions remain available.

You can undo an incorrect browser association without deleting its history. Customer erasure removes contact fields, linked retained history and derived caches, with background continuation for larger histories. Contact retention follows event retention. Minimal hashed suppression records prevent old deliveries from recreating an erased profile. After deletion completes, a trusted integration can explicitly set reactivate:true with new verified evidence, a new visitor and a consent decision newer than the deletion; old consent cannot reactivate the profile. Existing v1/v2 Identify integrations remain supported for pseudonymous links.

// On your backend, after verifying the signed-in account and CSRF:
const body = {
  version: 1,
  commandId: loginEventId, // Reuse this ID for retries of the same command.
  siteId: process.env.TRACKANY_SITE_ID || "default",
  visitorId: trackerContext.visitorId,
  sessionId: trackerContext.sessionId,
  occurredAt: new Date().toISOString(),
  action: "identify",
  source: "website",
  consent: profileConsent, // analytics, identifiedProfiles, decidedAt, policyVersion
  customer: {
    customerId: authenticatedCustomer.id,
    name: authenticatedCustomer.name,
    email: authenticatedCustomer.email,
    verification: "authenticated",
    emailVerified: authenticatedCustomer.emailVerified === true
  }
};
const response = await fetch("https://connect.trackany.click/v3/identify", {
  method: "POST",
  headers: { "Content-Type": "application/json",
    Authorization: "Bearer " + process.env.TRACKANY_SECRET_KEY },
  body: JSON.stringify(body)
});
if (!response.ok) throw new Error("Identification pending: " + response.status);
const result = await response.json();
// rotation_required: reset the browser visitor before identifying the next account.
// conflict: correct the source account IDs; the accounts remain separate. No merge occurred.
14

Choose an event model

Define a small vocabulary before implementation, for example page_view → form_submitted → qualified_lead → purchase. Keep acquisition activity and later customer outcomes as distinct events so reports can show the observed order and trust source.

15

Preserve campaign attribution

Use consistent utm_source, utm_medium, utm_campaign and stable provider identifiers such as utm_id, utm_adgroup_id and utm_ad_id. TrackAny.Click retains first touch, current session touch and last non-direct touch separately; campaign names alone are not reliable join keys.

16

Batching and outcomes

POST 1–100 events to /v1/events/batch when a server process has several independent facts. The service validates the complete batch first and can return HTTP 207 with per-event results if only some writes succeed. Keep each event ID and payload for safe retry.

17

Read journeys and handle failures

HTTP 202 means the event was accepted. Handle 400 as a contract or timestamp error, 401 as an invalid project key, 402 as quota or credits required, 403 as an origin restriction, 409 as event-ID reuse with changed content and 429 as rate limiting. Retry transient failures with the unchanged event ID and payload.

Journey and funnel reports are bounded views, not an identity graph: they expose coverage and truncation, keep currencies and trust sources separate, and do not claim cross-device certainty.