TenanciTenanci

Help centerMarketing & A/B tests

Goals and events (tenanci.track)

Record conversions (lead, sign-up, purchase) with tenanci.track(), by a page visit or automatically (form, WhatsApp, phone), and see results by source.

A goal is what counts as success on the customer's domain: a sign-up, an order, a click on WhatsApp. With goals in place you see how many conversions each source brought in, compare landing pages in A/B tests and feed the customer's ad accounts.

Three ways to record

Way Needs code? When to use
tenanci.track() yes, one line in the app the event happens inside the app (sign-up completed, payment approved)
Page goal no there's a "thank you" page (e.g. /thank-you)
Automatic goals no forms, WhatsApp buttons and phone links

They all show up together in the Goals (last 30 days) card in the Marketing tab.

Record with tenanci.track()

Call it in your app at the moment the conversion happens:

// sign-up completed
window.tenanci?.track("CompleteRegistration");

// purchase approved, with value
window.tenanci?.track("Purchase", { value: 497, currency: "BRL" });

What happens on each call:

  • the event goes to every pixel enabled on the domain (GA4, Meta, TikTok, Pinterest) and to Google Tag Manager's dataLayer, with an event_id;
  • Tenanci records the goal in analytics and, if configured, also sends it from the server (Server-side conversions), with the same event_id so it isn't counted twice.
Parameter What it is
name (1st argument) goal name (up to 100 characters). The same name always adds up to the same goal.
value numeric value (e.g. 497 or 99.9), optional
currency 3-letter code (BRL, USD), optional
other fields passed on to the pixels as event properties

In TypeScript, declare the type once:

declare global {
  interface Window {
    tenanci?: { track(name: string, props?: Record<string, unknown>): void; consent(): void };
  }
}

Recommended names

Use Meta's standard event names whenever they fit. They reach Meta as standard events (anything else goes as a custom event), and Pinterest and GA4 get the equivalent:

Name Use Pinterest GA4 (server-side)
Lead contact, quote, enrollment lead generate_lead
CompleteRegistration sign-up completed signup sign_up
Purchase purchase/payment checkout purchase
AddToCart added to cart addtocart add_to_cart
InitiateCheckout started checkout — begin_checkout
Contact, Subscribe, Schedule, StartTrial contact, subscription, booking, trial start — contact, subscribe, …

Page goals (no code)

When the conversion ends on its own page (e.g. /thank-you), just say which page it is:

  1. In the Marketing tab, in the Goals (last 30 days) card, go to Page goals.
  2. Fill in the Goal name (e.g. Lead): letters, digits, spaces and _, starting with a letter.
  3. In Page, enter the path (you can paste the full URL; Tenanci keeps only the path).
  4. Optional: a Value (optional) for each conversion (in BRL).
  5. Click Add goal.
Page Counts when the visitor opens
/thank-you exactly /thank-you (with or without a trailing slash)
/order/* /order and everything below it (/order/123/confirmed)
/thank-you* any path starting with /thank-you (/thank-you-lead, /thank-you/vip)

Up to 50 page goals per domain. They are counted by Tenanci's analytics script (on by default for every domain) and also work in SPAs.

Automatic goals

Without any setup, the analytics script records three goals on any page of the domain (their names are in Portuguese):

  • Formulário enviado (form submitted): any form submission;
  • WhatsApp: clicks on wa.me, whatsapp.com or whatsapp: links;
  • Telefone (phone): clicks on tel: links.

They appear among the goals and can be the goal of an A/B test. They are not sent to ad accounts: to send a lead to Meta, use tenanci.track("Lead") or a page goal.

See the results

The Goals (last 30 days) card shows, for each goal, the number of conversions and the total value. Next to it, By visit source splits conversions by channel (Direct, Search, Social, Websites, E-mail, Campaign), based on the source of the first visit of the day of each visitor who converted.

For conversions by utm_campaign, with cost and return, see Campaigns.

Through the API

Page goals: POST /domains/:id/goals, GET /domains/:id/goals and DELETE /domains/:id/goals/:goalId.

cURL
curl -X POST https://api.tenanci.com/v2/domains/dom_4h7n1q/goals \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"Lead","pathPattern":"/thank-you","value":50,"currency":"BRL"}'

Totals (goals, sources and campaigns) come from GET /domains/:id/analytics/campaigns:

SDK (Node)
const stats = await tenanci.analytics.campaigns("dom_4h7n1q", { from: "2026-10-01T00:00:00Z", to: "2026-11-01T00:00:00Z" });
// stats.goals → [{ name: "Lead", conversions: 42, value: 2100, ... }]

Common issues

  • window.tenanci doesn't exist: fill in at least one tag or turn on the banner in the Marketing tab and reload the page.
  • The page goal doesn't count: check the path (no domain, starting with /) and whether the pattern needs *.
  • Numbers differ from Meta/GA4: with the banner on, pixels only get events from visitors who accepted; Tenanci's dashboard counts every conversion.