Saasco logoSaasco logo
Saasco logoSaasco logo

Introduction

OverviewGetting startedWhat is Saasco?

SDK

Quick startTrackingIdentifyConfigurationWidgetsProperties

MCP

Quick startHow it worksAuthorizationTool reference

REST API

Quick start

Identify

Tie anonymous activity to a CRM contact, before or after they have an account.

Until you identify someone, Saasco knows a visitor id and a session id and nothing else. identify() connects that activity to a CRM contact, which is what makes drip campaigns, segments and support history work.

import { saasco } from "../lib/saasco";

function signedIn(user) {
  saasco.identify(user.id, {
    name: "Tony Hawk",
    email: "tony@xgames.com",
    bestTrick: 900,
  });
}

function signedOut() {
  saasco.logout();
}

The first argument is a Distinct ID, normally the user's primary key in your own database. The second is any properties you want on the contact.

Call identify when someone logs in or their details change, not on every page load. Repeat calls with the same id and the same traits are skipped, but the first one of each page still costs a request.

The same call is mirrored into the support widget, so the agent knows who it's talking to. That forwarding isn't gated by the dashboard toggle; the toggle only decides whether the widget loader downloads. If you load the standalone support loader without the analytics SDK, call window.SaascoSupport.identify(...) yourself.

People without an account yet

You often have contact details before there's a user record: a newsletter subscribe, a waitlist, step one of a signup flow. Skip the id and pass properties only:

saasco.identify({
  name: "Tony Hawk",
  email: "tony@xgames.com",
  bestTrick: 900,
});

Include an email. That is what makes the contact useful to email marketing, and what lets Saasco merge it later.

Soft vs full identify

Identifying without an id is a soft identify: the SDK mints a soft_* distinct id and creates a real CRM contact against it. When that person later signs up and you identify them with your database id and the same email, the soft contact is merged into the full one and their earlier activity comes with it.

Both kinds create a contact. The CRM does not label them "lead" versus "customer" on this basis; that's for you to model with properties or lists.

Signing out

saasco.logout();

logout() clears the user cookie, mints a fresh session and anonymous id, clears the support widget's identity, and drops last-touch UTM and referrer so the next visitor on a shared machine starts clean.

It is the sign-out helper you want. identify(null) does most of the same work but keeps last-touch attribution, and does not POST an identify event.

Reserved contact properties

These property names have meaning to the rest of the product: email marketing reads email, and the CRM header reads name and avatar. Use the exact keys:

PropertyTypeDescription
emailStringEmail address. Required for anything that sends mail.
nameStringFull name.
firstNameStringFirst name.
lastNameStringLast name.
displayNameStringPreferred display name; defaults to firstName lastName.
titleStringJob title (e.g. "VP of Engineering").
phoneStringPhone number.
avatarStringURL to an avatar image.
usernameStringUsername; should be unique per user.
websiteStringPersonal or company website.
descriptionStringBio or about text.
genderStringGender.
ageNumberAge.
birthdayDateDate of birth.
createdAtDateWhen the account was created. ISO 8601 strings are recommended.

Anything else you pass is stored as a custom attribute and is filterable in the CRM the same way.

Keys beginning with $ are system-managed, so don't set them. See Properties for what Saasco fills in on its own.

Tracking

Page views, custom events, and sending events from your server.

Configuration

Constructor options, script-tag attributes, debug switches and ad pixels.

On this page

People without an account yetSoft vs full identifySigning outReserved contact properties