Getting Started
Sending your users data

Sending your users data

💡

This guide is for SaaS or subscription-based businesses only.

Usermaven supports client-side tracking via the same Javascript tracking script that powers website tracking. See this article on how to include the JavaScript tracking script in your application's frontend for tracking signed-in users.

Sending your app's user data will help you better understand how users interact with your site or app with Usermaven's pre-built product insights reports.

If the tracking script is already installed, the next step is adding or identifying people in Usermaven.

Identify contacts (people and companies)

This function allows you to attach a unique identity and maintain user histories across sessions, devices, and browsers under a single profile in Usermaven.

You must call the usermaven("id") method whenever a user signs-in to your app in order to identify logged-in users and attach the actions they perform in your app to the contacts (people and companies) database in Usermaven.

Calling this function creates or updates a profile in the Contacts hub. You can pass as many different attributes about that user or company as you like. Take some time to think about the name you give to your attributes. You can name them anything you like, but it's best to use clear, concise, and consistent names.

<script type="text/javascript">
    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",
          fav_sports: "football" 
      },
 
 
      // 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>

Please make sure that these calls are made after the tracking script, either by inserting them in your HTML after the script tags or by delaying their execution using the page load event.