How do I tag events with an account?
Associate the current visitor with an account by callingwindow.tinyanalytics.group(). From then on, every event that visitor sends is tagged with that account:
- A site can register up to 5 group types (for example
company,workspace). The first types you send claim the slots. - Pass traits to describe the account — its name, plan, or size — the same way user traits describe a person. Update them later with
setGroupTraits(type, traits). - Call
resetGroups()to forget the associations, for example when a user logs out.
group() persists the associations you provide in browser storage so later events keep their account context. Call resetGroups() at logout, and review Privacy & GDPR when assessing consent requirements.How do I switch reports to account grain?
Use the grain toggle on the dashboard. Once events are tagged, it swaps person-level metrics for account-level ones. The Users card becomes active accounts — the number of distinct accounts active in the period — and you can:- Filter to one account’s activity, keeping every event in that account’s sessions.
- Break down any report by account to see your top companies.
How do account-grain funnels and retention work?
Funnels and retention can measure the account instead of the session or person. This changes what “completed” and “returned” mean:- A funnel step counts for an account when any member, in any session reaches it — so a company converts even if one person started the trial and a colleague finished it.
- An account is retained when any seat returns in a later period, so a returning team reads as one retained account rather than several individual visitors.
What else does account grain unlock?
Two more things:- Inactivity alerts — get notified when an account that used to be active goes quiet, so you can reach out before it churns. See alerts.
- Flag targeting by account — evaluate a feature flag per account so every seat in one company shares the same rollout, and rollout percentages count accounts rather than people.
Frequently asked questions
How many group types can one site have?
How many group types can one site have?
Up to 5. A tinyanalytics site can register five group types — for example
company and workspace — and the first types you send claim the slots.When does a funnel step count for a whole account?
When does a funnel step count for a whole account?
When any member, in any session reaches it. An account-grain funnel in tinyanalytics credits the account even if one person started the trial and a colleague finished it. Retention works the same way: an account is retained when any seat returns in a later period.
How do I clear a visitor's account association when they log out?
How do I clear a visitor's account association when they log out?
Call
resetGroups(). It forgets the associations set by window.tinyanalytics.group(), so events the visitor sends afterward aren’t tagged with the previous account.Related
Identify users
Tag the individual people inside each account.
Alerts
Get notified when an account goes quiet.
Feature flags
Roll a feature out by account.
Retention
Measure whether accounts come back.