04 · Tracking
Count goals, and identify customers by email
A goal is a moment worth counting: a signup, a started checkout, a download. Identify ties a visitor to the email they pay with.
01Goals from your code
Call tally with the goal's name, and up to 10 properties if you like:
// Once, before your first call: it keeps calls made before the script has loaded.
window.tally = window.tally || function () { (tally.q = tally.q || []).push(arguments); };
tally('signup');
tally('checkout_started', { plan: 'pro', seats: 3 });
DataFast's window.datafast(name, props) is the same call, so goals written for it keep counting.
02Goals from your HTML
Give any element a data-tally-goal attribute, and each click on it counts as that goal. Its data-tally-goal-<key> attributes become properties, with dashes turned to underscores, so data-tally-goal-plan-type is plan_type:
<button data-tally-goal="signup">Start free</button>
<button data-tally-goal="upgrade" data-tally-goal-plan-type="pro">Upgrade</button>
data-fast-goal works the same way. A keyboard press on a button counts once: it fires the click.
03Names and properties
- A name is trimmed, lowercased, and its spaces become underscores; then it must be at most 64 characters of letters, digits,
_,:and-, or the goal isn't sent. - Up to 10 properties are kept. A key is lowercased and must be at most 32 characters of letters, digits,
_and-; others are dropped. Values are sent as text, at most 255 characters. - A property that can't become text drops the goal, and nothing is thrown into your page.
04Where goals show
The site's Goals page lists each goal with its completions and visitors, and each goal unfolds into its properties. A funnel there is 2 to 8 steps, each a page or a goal, that a visitor completes in order within a window you choose, from 30 minutes to 30 days.
05Identify a customer by email
When someone signs in, or lands on your success page, call identify with the email they pay with. A payment whose customer email matches is then linked to that visitor, with medium confidence: the way in for payments that carry no visitor id, such as invoices, or on a cookieless site.
// Once the customer is signed in (or on your success page), with the email they pay with.
// It is hashed when it arrives; only the hash is kept.
window.tally = window.tally || function () { (tally.q = tally.q || []).push(arguments); };
tally('identify', { email: user.email });
The email is hashed when it arrives and only the hash is kept. Anything that isn't an email address is dropped. DataFast's datafast('identify', { user_id }) works when the user_id is an email.
06Check it worked
07What isn't counted
Something missing, or not what you see? Write to support@tallybyoutpost.com and say which page.