Skip to Content
Getting StartedSending your users data

Sending your user data to ‘Contacts hub’ in Usermaven

This guide is primarily aimed at SaaS or subscription-based businesses looking to send signed-up user data to Usermaven’s ‘Contacts hub’.

Understanding your user’s behavior is key to growing your product and business. By sending user and company data to Usermaven’s ‘Contacts hub’, you unlock powerful, pre-built product insights reports that show you exactly how people interact with your application.

This guide explains how to identify your users and associate their attributes and actions with their profiles in Usermaven. This can be achieved through various methods:

  • Client-side SDKs: For identifying users directly from your web application’s frontend. This includes the direct Javascript snippet, our NPM package, or framework-specific SDKs (e.g., for React, Next.js, Vue.js, Angular). This guide will primarily focus on the payload structure common to these methods.
  • Server-side Methods: For sending or enriching user data from your backend systems, using our Server-side Events API or dedicated SDKs (Node.js, Python).

If you haven’t already, ensure that Usermaven tracking script is installed. You can find all available options in our Integrations & SDKs overview. Once tracking is in place, the next step is to specifically identify your users.


How to identify contacts (users and companies) using client-side methods

To connect on-site user activity to specific individuals and companies in Usermaven, you need to “identify” them. This process links all their actions, sessions, and devices to a single, unified profile in your ‘Contacts hub’.

On the client-side, you typically achieve this by calling an identify function provided by the Usermaven SDK you’ve integrated (e.g., the global usermaven("id") function for the direct Javascript snippet, or a similar method if using the NPM package or a framework-specific SDK).

⚠️

It’s crucial to call the identification method every time a user logs into your application or when their identity becomes known (e.g., after a sign-up). This ensures their actions are correctly attributed.

This function will either create a new profile in the ‘Contacts hub’ or update an existing one if the user or company ID already exists. You can include various attributes about the user or the company they belong to.

Choosing attributes:

  • Be thoughtful about the attributes you send.
  • Use clear, concise, and consistent naming conventions for your attributes (e.g., plan_type, user_role).
  • While you can name custom attributes almost anything, consistent naming will make data analysis much easier later.

Anonymizing personal attributes for enhanced privacy

For companies focused on enhanced user privacy or those needing to comply with strict data minimization policies, it’s possible to send anonymized or pseudonymized versions of personal data to Usermaven. This allows you to still gain valuable product insights while respecting user privacy.

The key is to implement the anonymization logic in your application before the data is sent to Usermaven.

Examples of anonymization:

  • Email Address: Instead of sending john.doe@example.com, you could send:
    • A partially stripped version: j***@example.com or ****@example.com
    • A version with a domain only, if user-specific part is too sensitive: anon_user@example.com (ensure consistency if this value is used as a fallback identifier).
  • Names: John Doe could become User J.D..
  • Other Identifiable Information: Review any custom attributes you plan to send and apply similar anonymization techniques if they contain PII.

The id attribute (your system’s unique user identifier) must always be sent accurately and consistently for each user. This ID is crucial for Usermaven to correctly track user journeys and stitch sessions, even if other personal attributes are anonymized or omitted. Do not anonymize this primary id.

Impact on Usermaven functionality:

  • Core tracking remains: User counts, event tracking, session stitching, and product insights reports based on the primary id and non-PII attributes will continue to function.
  • Limited PII-based features: Searching for users by their full original email or name within the Usermaven UI will not be possible if this data is anonymized. Segmentation based on the original, non-anonymized values of these attributes will also be affected.

Consider the level of anonymization that balances your privacy requirements with your analytics needs.

The core data payload for identification generally looks like this:

<script type="text/javascript"> // This example uses the global function available with the direct JavaScript snippet. // If using NPM or a framework SDK (React, Vue, Next.js, etc.), // the method to call might be slightly different (e.g., usermaven.id({...})), // but the payload structure for attributes remains similar. usermaven("id", {       // Required attributes       id: "XXXXXXX",                       // Unique ID for the user as per your records.       email: "user@domain.com",            // Email address of the user signing-in.       // Optional but strongly recommended attributes       created_at: "2021-01-20T09:55:35",   // Date/Time (in ISO 8601 format) when the user first signed-up.       first_name: "John",       last_name: "Smith",       // Other optional attributes (You can name attributes whatever you want)       custom: {           gender: "female",           role: "admin"       },       // If you are a B2B SaaS and your product is used by multiple users in a company, you should pass the company attributes as shown below.       company: {         // Required attributes         id: "XXXXXXXX",                  // Company ID as per your records.         name: "TESLA",                   // Company name as per your records.        // Optional but strongly recommended attributes         created_at: "2021-01-20T09:55:35",   // Date/Time (in ISO 8601 format) when the company first signed-up.         // Optional company attributes         custom: {           plan: "enterprise",           industry: "technology"         }       } } ); </script>

Ensure the Usermaven tracking script or SDK is fully initialized before you make any identification calls. For the direct Javascript snippet, this means placing the usermaven("id") call after the main tracking script. For NPM or framework SDKs, follow their specific initialization instructions.


Other ways to send or enrich contact data: Server-side methods

While client-side identification is excellent for capturing user data directly from the browser, you might have other valuable user or company attributes stored on your backend, or you may want to identify users or update their profiles based on server-side events (e.g., a subscription payment, a feature enabled via an admin panel).

For these scenarios, Usermaven offers several server-side options:

  • Server-side Events API: Our primary REST API for sending any custom events or user/company identification and attribute data directly from your backend systems. This offers the most flexibility.
  • Node.js SDK & Python SDK: These SDKs act as convenient wrappers that simplify interaction with our Events API if you’re working in Node.js or Python environments.
  • Segment CDP Integration: If you use Segment as your Customer Data Platform, you can configure it to send event data, including user identifications and attributes, to Usermaven.

Please refer to our comprehensive Integrations & SDKs overview for detailed guides on each method and for other potential integrations.


How identity resolution and stitching works

Properly identifying your users across different platforms (client-side and server-side) enables Usermaven’s powerful identity resolution feature. This allows you to accurately connect and merge user data across different sessions, devices, and even between anonymous Browse activity and their known profile post-login or identification.

When a user who was previously Browse anonymously logs in or signs up (and you identify them via any of the methods described), their past anonymous activity is automatically stitched to their newly identified profile.

This stitching process provides a complete, uninterrupted view of the customer journey—from their very first anonymous visit to conversion and beyond, helping you unlock more meaningful insights.

To learn more about how this works and its benefits, please follow our full guide: Read the full identity resolution guide →


If you still face any problems after following the above steps, please reach out to our support team via in-app live chat or email at support@usermaven.com.

Last updated on