CrowdPower
  • 👋Introduction
  • ✅Getting Started
    • The Basics
    • JavaScript Tag
      • Identify Customer
      • Create Customer Event
      • Create Customer Charge
      • Create Customer Tag
      • Create Page View
      • Prompt for Push
    • Beacon API
      • Identify Customer
      • Create Customer Event
      • Create Customer Charge
      • Create Customer Tag
      • Track
    • Importing Customers
    • Basic Email Setup
    • Advanced Email Setup
  • 📚Resources
    • Smart Sending
    • Working with Sessions
    • Working with Traits
    • Working with Phone Numbers
    • Personalizing Messages
    • Push Notifications
    • Unsubscribe Groups
  • 🔌Integrations
    • Discord
    • Slack
    • Stripe
    • Zapier
  • REST API
  • Console
Powered by GitBook
On this page

Was this helpful?

  1. Getting Started
  2. JavaScript Tag

Identify Customer

Creates a new customer or updates an existing customer record.

When a customer signs up or logs into your website, you should call the identify method first. This will create or update the customer record in CrowdPower. You will also want to call this method whenever something about the customer record changes — like if they are now a paying customer, or they updated their profile on your website.

<script>
  window.cp('identify', {
    user_id: '<user_id>', // Unique user ID (required)
    email: '<email>', // Email address
    name: '<name>', // Full name (splits into first and last name)
  });
</script>

You may also include these additional properties...

<script>
  window.cp('identify', {
    ...
    first_name: '<first_name>', // First name, prioritized over name
    last_name: '<last_name>', // Last name, prioritized over name
    signed_up_at: '<signed_up_at>', // Signup date as a unix timestamp
    custom_attributes: {
      '<key>': '<value>', // Optional custom attributes
    }
  });
</script>

The preferred method for sending in custom attributes is to use snake_case for keys, and UNIX timestamps (in seconds) for date values.

PreviousJavaScript TagNextCreate Customer Event

Last updated 2 years ago

Was this helpful?

Custom attributes can be formatted in the section to be displayed to you as a string, boolean, or date.

✅
Traits