Solved

User properties not set on Identify

  • 14 May 2023
  • 3 replies
  • 329 views

Hi, I have a new amplitude installation on my website and I’m not able to get user properties to show up in amplitude. I am migrating from Heap. Sessions and events are being tracked in amplitude, just without any user properties (ie. “email”).

In my code I have:

<script type="text/javascript">
const properties = {
plan: '3',
payment_method: 'stripe',
account_type_id: '1',
profile_complete: '1',
handle: 'test',
dashboard_url: 'https://test.com/dashboard/',
company_id: '1',
company_name: 'test',
joindate: '1245300441',
contact_name: 'test test',
first_name: 'Test',
last_name: 'Test',
user_id: '1',
email: 'test@test.com',
billing_frequency: 'month',
};
if (window.amplitude){
const identifyEvent = new window.amplitude.Identify();
identifyEvent.set(properties);
window.amplitude.identify(identifyEvent);
}
</script>

 

What I see in the network tab is an empty user_properties object:

 

Based on some other threads, I thought the issue might be that I need to pre-define these user properties in the Amplitude dashboard. I did that and it’s still not working.

 

 

Please help!

Thank you

icon

Best answer by franciskafyi 16 May 2023, 01:08

View original

3 replies

Userlevel 5
Badge +8

Hi @Paul Loeb welcome to the community! I’ve escalated this to our technical support team to look into and help troubleshoot!

Userlevel 2
Badge +5

Hey @Paul Loeb,

I’m not the most technical person out there, but I’ll try my best.

You’re not required to add your User Properties in Data so that is not why your user properties are not showing up. 

Have you followed our documentation for how to set user properties? I see in your code that you’ve added the user props separately as opposed to how we show it in our documentation.

Thank you, that documentation solved our problem

 

We were able to iterate through our list of properties and set them one by one.

Object.entries(properties).map(([key, value]) => {
identifyEvent.set(key, value);
});

 

Reply