Share this guide
Pixel Custom Events

Identify visitors in code (HTML / JavaScript)

Tell FunnelTrack who a visitor is the moment you know, such as at login or an email opt-in, without sending a conversion. Their hashed contact info is attached to the session, so later events and offline conversions match back to them.

What Identify does

Identify
Sends a conversion to ad platformsNo. Nothing is dispatched and it doesn't count toward your event usage.
What it sendsContact info only: email, phone, first name, last name, city, region, zip, country.
PrivacyEvery field is hashed with SHA-256 in the browser. Raw values never leave the page.
Why use itBinds the visitor to a contact, so their later events carry stronger match data and offline conversions (CRM stages, closed deals) can be matched back to their web session.
Before you start
The FunnelTrack pixel must be on the page. See Deploy the FunnelTrack pixel. Using Google Tag Manager instead? See Identify visitors with Google Tag Manager.

1. Identify when you learn who the visitor is

Call window.ft.identify() at login, sign-up, or opt-in.

1

Call identify()

Pass whichever contact fields you have. Email and phone give the strongest match.

window.ft.identify({
  email: "jane@example.com",
  phone: "+15555550123",
  first_name: "Jane",
  last_name: "Doe"
  // city, region, zip, country also accepted
});
2

Example: identify on form submit

<script>
  document.querySelector("#newsletter-form").addEventListener("submit", function (e) {
    var emailEl = e.target.querySelector('input[type="email"]');
    if (emailEl && emailEl.value) {
      window.ft.identify({ email: emailEl.value });
    }
  });
</script>

The pixel snippet queues identify() calls made before it finishes loading, so you can call it any time after the snippet.

2. Identify on page load (logged-in visitors)

Bind contact info to the very first hit, before any interaction.

If your page already knows the visitor, set their contact fields on window.__ft_upd before the pixel snippet. The pixel hashes them in the browser and attaches them to the automatic page view, so the contact is bound on the first hit.

<script>
  window.__ft_upd = {
    email: "jane@example.com",
    first_name: "Jane"
  };
</script>
<!-- FunnelTrack Pixel snippet from your dashboard goes here -->

Render the values server-side from the logged-in user. Leave the block out for visitors you don't know.

HTTPS required
Hashing uses window.crypto.subtle, which only works over HTTPS (or localhost). On plain http:// pages the Identify call is skipped.
Sending an event too?
If the same moment is also a conversion (like a sign-up), you don't need a separate identify call. Pass the contact fields on window.ft.event() instead. See Send pixel events directly.

More pixel guides