If your users login and you would like to identify their activity in Swishjam you can use the .indentify
function
Import Swishjam into your component
import { swishjam } from '@swishjam/react';
Identify your users
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
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>
)
}
Import Swishjam into your component
import { swishjam } from '@swishjam/react';
Identify your users
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
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>
)
}
Identify your users
Verify Swishjam is loaded in your footer
swishjam.identify('user@example.com', {
...include your data here
})
Once a user is identified we will track events triggered during the same session to that user