Skip to main content

Identify scanner profiles with your own user IDs using the Insights SDK

Link anonymous scanner profiles in Insights to known users from your CRM, login, or forms

Written by Bidisha Sinha

When someone scans your QR code, Insights creates an anonymous scanner profile for their device. With the Insights SDK's identify() method, you can attach your own identifier to that profile — such as an email address or a user ID from your CRM or login system — as soon as the person becomes known on your site. You don't need to use Uniqode Forms to do this.

Before you start

Make sure the following are in place:

  • The Insights pixel is deployed and verified on the page where you'll call identify().

  • The visitor arrived by scanning a Uniqode QR code. The scan is what creates the anonymous scanner profile. identify() links your identifier to that profile, so it only has an effect for visitors who came in through a scan.

How insights.identify() works

Argument

Type

Description

identifier

String

The value you use to identify this person, such as an email address or a user ID from your system.

properties

Object

Must include identifier (the same value as the first argument) and identifierType (the kind of identifier, e.g. 'email').

identify() returns a Promise.

Example:

insights.identify('abc@example.com', { identifier: 'abc@example.com', identifierType: 'email'});

When to call it

Call identify() at the moment a visitor becomes known, for example after they:

  • Log in

  • Sign up

  • Submit a form

  • Are otherwise identified by your system

Call it once per session, not on every page load.

Add identify() to your site

Most teams use one of the two methods below. Choose the one that matches how you manage scripts on your site.

Option 1: Call identify() directly in your JavaScript

Use this if you can edit your site's code. The example below calls identify() when a visitor submits a sign-up form.

  1. Find the form or event on your page where the visitor becomes known (for example, your sign-up or login form).

  2. Add a handler that reads the identifier, normalizes it, and calls insights.identify():

    <script>
    document.getElementById('signup-form').addEventListener('submit', function () {
    // Normalize the email so the same person always maps to the same identity
    var email = document.getElementById('email').value.trim().toLowerCase();
    if (window.insights && email) {
    insights.identify(email, {
    identifier: email,
    identifierType: 'email'
    }).catch(function (err) {
    console.warn('Insights identify failed', err);
    });
    }
    });
    </script>
  3. Replace signup-form and email with the IDs of your own form and email field.

  4. Publish your changes and test by scanning one of your QR codes, then submitting the form.

Option 2: Call identify() using Google Tag Manager

Use this if you manage tracking scripts through Google Tag Manager (GTM).

  1. In GTM, make sure the identifier you want to send (for example, the visitor's email) is available as a variable. A common way to do this is to push it to the data layer when the user logs in or submits a form, and read it with a Data Layer Variable.

  2. Go to Tags and click New.

  3. Choose Custom HTML as the tag type and paste in the following code:

    <script>
    (function () {
    // Replace {{User Email}} with the name of your GTM variable
    var id = String({{User Email}} || '').trim().toLowerCase();
    if (window.insights && id) {
    insights.identify(id, {
    identifier: id,
    identifierType: 'email'
    }).catch(function (err) {
    console.warn('Insights identify failed', err);
    });
    }
    })();
    </script>
  4. Under Triggering, select the trigger that fires when the visitor becomes known — for example, a form submission trigger or a custom event such as login or sign_up.

  5. Make sure this tag fires after the Insights pixel has loaded on the page.

  6. Save the tag, test it in GTM Preview mode, and then Submit to publish.

Note: Don't place the tag on an "All Pages" trigger. identify() should run once, when the visitor is identified — not on every page view.

What happens after you call identify()

  • The visitor's scanner profile in Insights shows the identifier you sent (for example, their email address or user ID) instead of appearing as anonymous.

  • Events from that session are attributed to the identified profile, so you can see which known user scanned which QR code and what they did next.

Limitations

  • One device = one profile. If the same person scans on two different devices (for example, their phone and a tablet), Insights treats these as two separate profiles. Profiles are not merged across devices.

  • Identifiers are case-sensitive. Jane@acme.com and jane@acme.com are treated as two different identities. Normalize identifiers before sending them — for example, trim spaces and convert emails to lowercase.

  • Don't send sensitive personal data. Never pass Social Security numbers, credit card numbers, passwords, health information, or similar sensitive data as the identifier or in the properties object.

Tips for best results

  • Use the same identifier your team already uses Send the same email or user ID that's stored in your CRM or auth system, so you can match Insights profiles to your records.

  • Normalize every time, in every place If you call identify() from more than one page or tool, apply the same normalization everywhere so one person never ends up with two identities.

  • Test with a real scan Scan one of your QR codes on your phone, complete the login or form on your site, and confirm the profile shows as identified in Insights before rolling out widely.

Did this answer your question?