Identify Customers

This page will help you understand how you can manage customer profiles on Growlytics using Android sdk.

A User is automatically created in Growlytics platrorm when user opens the app first time.

Initially, there are very few properties captured for User Profile like city, country, device info etc. Depending on your product purpose, You can add more information to user profile with Analytics.identify() method.

There are two ways you can do this

  1. If your customer has logged in with your system's user id, then you can pass customer's id which is in your system. This will help you keeping unified profile across web, mobile and other platforms. An example is given below.

    // Prepare Attributes
    Map<String, Object> userAttributes = new HashMap<>();
    attributes.put("has_subscribed", true);
    attributes.put("total_cart_visits", 12);
    
    // Put them in growlytics user profile
    Analytics.getInstance(this).identify(userAttributes);
  2. Another way, if user has not logged in yet but you still want to keep information as anonymous user, you can do that as well. An example is given below.

    // Prepare Attributes
    Map<String, Object> userAttributes = new HashMap<>();
    attributes.put("has_subscribed", true);
    attributes.put("total_cart_visits", 12);
    
    // Put them in growlytics user profile
    Analytics.getInstance(this).identify(userAttributes);

Last updated