If your users login and you would like to identify their activity in Swishjam you can use the .indentify function

  • React

  • Browser

Import Swishjam into your component

import { swishjam } from '@swishjam/react';

Identify your users

Simple Swishjam Import
swishjam.identify('your-unique-user-identifier', {
  firstName: 'john',
  lastName: 'doe',
  email: 'john.doe@example.com',
  // more attributes
})
Once a user is identified we will track events triggered during the same session to that user

Full Example Code

Standard Swishjam Import
import { swishjam } from '@swishjam/react';

export default function YourComponent() {
  const logUserIn = () => {
    // your login logic
    swishjam.identify('your-unique-user-identifier', {
      firstName: 'john',
      lastName: 'doe',
      email: 'john.doe@example.com',
      // more attributes
    })
  }

  return (
    <button onClick={(e) => logUserIn()}>
      Login
    </button>        
  )
}