identify() says who the visitor is; track() records something they did.
If you’ve used Segment, PostHog or Amplitude, this is the same shape. Coming from Marketo:
identify() is roughly associateLead, and there’s no Munchkin equivalent of track() at all — anything that wasn’t a page visit or a link click had to become a form submission or an API call.identify()
Call it when your site already knows who someone is — after a login, a signup, or on an account page.email is the one that matters, because it’s what connects an anonymous visitor to a known person.
Call it once per page, after you know. Calling it repeatedly with the same values is harmless but wasteful.
track()
Object Verbed, in title case — Pricing Calculator Used, Demo Requested. It’s only a convention, but consistency is what makes the events usable six months later.
Traits versus properties. Traits describe the person — name, company, plan — and belong in
identify(). Properties describe what happened — which button, how many seats — and belong in track().Calls made before the script loads
The script loads asynchronously, so your code may run first. Queue calls and they’re replayed in order once the tag is ready. Put this above the script tag:window.agq.push keeps working after the tag has loaded, so you never have to branch on whether it’s ready. One bad queued call doesn’t stop the rest.
What allGood adds, and won’t take from you
Both calls travel as the same kind of event, batched a few at a time. allGood stamps on the things a page shouldn’t be able to choose: when it was received, what the request said about itself, which account it came from, and which device. There’s no timestamp argument, and one won’t be accepted. A page-supplied time is a time the page could choose.URLs get cleaned up
If you send aurl property, allGood pulls out the attribution parameters — any utm_ value, plus the usual advertising click ids — as fields of their own, then replaces anything in the query string that looks like an email address, or that’s very long, with a marker. Don’t put personal data in a URL and expect it to survive.
Consent applies
Both calls go through the same gate as page views. Under the default posture, calls made before your consent platform answers are held and then sent on a yes; on a no, they’re discarded and nothing more is sent for that page load. See What consent gates.Two settings can silence these
If your calls produce nothing, check the first one before debugging your code.
Where the events land
Each becomes an activity in that person’s history, the same place a form submission lands. Theemail on an identify() is what resolves an anonymous device to a known person.