APIs & Integrations

Ampjar
Member

Segment Don't Update Custom Contact Properties

am using segment as a source and hubpost as destination . currently am on Entriprise plan of hub spot. 

 

what am trying to do is update a contact custom properties . but this is not happening.

when using this code as follow :-
analytics.page()
analytics.identify(22,{ some_custom_prop : 20 })
analytics.track('Some Event')

the contact properties aren't updated . but when using segment event tester the contact properties are updated . 

i tried to reach segment . but after conversation this was there reply :-

Hi Ahmed, I did a few tests today and Segment does appear to be loading HubSpot on your website: ​ And we do appear to be sending data: (Screenshot) I'm not 100% sure why that data is not being received in HubSpot after a bit of poking around, on our end it looks like it should be. I'd recommend as a next step, reaching out to HubSpot support. I know they have a portal, so you can't really loop me in, but let me know what they say, and if I can provide additional information. That said, right now, from the Segment side, you seem good to go! Best, Tori Success Engineer @ Segment

Screen Shot 2019-09-30 at 11.55.11 AM.png

0 Upvotes
18 Replies 18
FBuschkotte
Member

Segment Don't Update Custom Contact Properties

@WendyGoh @Ampjar hey, I have the same issue: hubspot won't receive custom props with segment integration. Did you guys fix it?

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Segment Don't Update Custom Contact Properties

Hi @Ampjar,

 

I hope all is well with you 😄

 

To get a full picture of thing, are you trying to use Segment and pass form submission data into HubSpot? If so, do you mind sharing with me how are you doing this? And do you mean that all the default properties got pass through just fine except for the custom property? Could you share with me the custom properties you're referring to?

 

On my end, I submitted the registration form and login upon registration and I'm able to see that both form submission (login and registration form) has been recorded in your portal 6123641. I'm also able to see the form submission details information such as email and phone number.

 

Looking forward to your reply so that we can work together to resolve this issue!

0 Upvotes
Ampjar
Member

Segment Don't Update Custom Contact Properties

hey

what am trying to do is use segment to update custom properties and this is my code 

 analytics.load('segmentId');
analytics.page();
analytics.identify(1233, {
            'email' :  'somemeail',
            'first_name' :  'firstname',
            'full_name' :  'fullName',
            'last_name' :  'lastName',
            'subscribers_count' : 20,  #this is custom property
             'campaigns_count' : 30  #this is custom property
});
analytics.track('User Login',{'
            'email' :  'somemeail',
            'first_name' :  'firstname',
            'full_name' :  'fullName',
            'last_name' :  'lastName',
            'phone_number' : 'phoneNumber',
            'company' : {
                      "id":"1",
                       "name": "companyName"
                    }
})

so the default properties pass fine. but for custom properties, they aren't passed and the contact didn't updated.

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Segment Don't Update Custom Contact Properties

Hi @Ampjar,

 

Thank you for providing those information!

 

When looking into the custom properties that you have created in your portal 6123641, I noticed that while there's a custom property with an internal value subscribers_count, I wasn't able to locate the campaigns_count property.

 

Additionally, the subscribers_count property has a field type of 'single-line text' however it seems that you'd like to pass it an integer which should be a field type 'number' in HubSpot.

 

I believe it is not coming through because:

#1 The subscribers_count property field type is wrongly mapped and

#2 There is no campaigns_count custom property

 

You may want to check on the above.

0 Upvotes
Ampjar
Member

Segment Don't Update Custom Contact Properties

hey Windy

i tried to do the solutions as you suggested. but it didn't update the custom properties.

and here are screenshots .

Screenshot from 2019-10-03 07-54-50.pngScreenshot from 2019-10-03 07-54-34.pngScreenshot from 2019-10-03 07-52-13.pngScreenshot from 2019-10-03 07-52-10.png

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Segment Don't Update Custom Contact Properties

Hi @Ampjar,

 

Thank you for sharing that across.

 

Digging further into this, I went into your portal 6123641 and locate the contact with the email address: ahmedlocaltest@gmail.com. I noticed that the default contact properties didn't got pass through as well (firstname, lastname) which you mentioned it previously did. Would you mind checking if the test you conduct previously matches with this test?

 

The reason I asked this is because, when looking through the segment documentation here: https://segment.com/docs/destinations/hubspot/, I would believe you would need to first run the identify method then track it.

 

On top of that, HubSpot default properties doesn't have the underscore

e.g. for first name - the internal value is firstName,

for last name - the internal value is lastName

for phone number - the internal value is phone

 

As such, it doesn't appear to me that the test you run would update the default properties as well. 

0 Upvotes
Ampjar
Member

Segment Don't Update Custom Contact Properties

hey yes you are right the default properties aren't event updated . 

i tried to run the test again with multiple variatiations like (firstName , firstname) but didn't update .

and currently am running identify then track methods .

Screenshot from 2019-10-04 10-31-10.png

0 Upvotes
Ampjar
Member

Segment Don't Update Custom Contact Properties

@WendyGoh  any updates regarding this thread .

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Segment Don't Update Custom Contact Properties

Hi @Ampjar,

 

Sorry that this slips through the cracks.

 

In this case, would you mind doing the following:

 

#1 Identify a new contact using the following code documented here:

analytics.identify('user1234', {
  email: 'hstest123@hstest.com',
  firstname: 'hstest',
  lastname: '123'
})

#2 Next, send the following track event:

analytics.track("Clicked Buy Now button", {
  value: 20.5
})

Let me know if this created a contact?

 

On my end, I also tried using our identify function and both the  trackPageView or trackEvent functions and my contact hstestoct15@hstest.com was created successfully on your portal 6123641

 

identify.png

 

I would expect that if this is working, using it on segment would work as well.

0 Upvotes
Ampjar
Member

Segment Don't Update Custom Contact Properties

hey @WendyGoh 

 

your example worked fine . but there's some cases i have tried.

 

after creating `htest` user i deleted it and then tried to recreate it. but didn't create . then after i changed the identify id it created again .

another thing i tried to use first_name , last_name with the same example and it worked . cause i think segment is smart enought to change the properties as hubspot api wants .

and the last thing the email property isn't set as specified. like if i put '

hstest123@hstest.com' . i found the email in hubspot as my logged in email on my app 'ahmedlocaltest@gmail.com' .





0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Segment Don't Update Custom Contact Properties

Hi @Ampjar,

 

As stated on this community thread by Derek: https://community.hubspot.com/t5/APIs-Integrations/Create-Contact-Using-JavaScript-Tracking-Code-API..., it is expected that if a contact has been deleted from your portal, while you wouldn't be able to create it again using the Tracking Code API, you can still use other methods to re-create the contact such as creating it on your portal or using contact API

 

The reason as Derek stated:

"The tracking code API is different, though; with the tracking code API, contacts can be created as a result of normal visitor tracking. If a contact is deleted by a user, we’ll stop collecting their analytics info. Since the tracking code API contact creation occurs as a result of the normal visitor tracking, we’ll also stop collecting that. This mirrors the way the existing visit/page view tracking functions. Note that if the contact submits a form, or is created by a user, the analytics info will still exist and continue being collected."

 

i hope this helps to clarify things. 

 

As for the contact logging it as ahmedlocaltest@gmail.com, that's truly strange. Would you mind trying in on a private (incognito) browser to prevent any caching or cookie issue and see if it creates a new contact instead of overwriting it?

0 Upvotes
Ampjar
Member

Segment Don't Update Custom Contact Properties

@WendyGoh  thanks alot . this clarify things .

for email i tried to open from new icongnito window and make hard reload but still it takes the current email i logged in with . but currently that's not a problem .

my main problem is custom and normal properties aren't set . so when trying this structure from segment it didn't add the default properties. not sure why

Structure didn't workStructure didn't work

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Segment Don't Update Custom Contact Properties

Hi @Ampjar,

 

That's odd. I ran another test to track both custom property - subscribers count and default property - firstName and I was able to see that the contact hstestoct16@hstest.com has both the firstName and subscribers count property updated via the tracking code API:

trackingCodeAPI.png

 

Could you try this and see if it works?

0 Upvotes
Ampjar
Member

Segment Don't Update Custom Contact Properties

@WendyGoh i tried the same code and it worked perfectly. so in this case is it segment issue ?

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Segment Don't Update Custom Contact Properties

Hi @Ampjar,

 

Since we are unable to reproduce this behavior when using the HubSpot identify and track pageviews/event function, it could be that Segment is passing custom properties differently. Your team may want to check in with them and pass along our testing. Let me know how it goes!

0 Upvotes
Ampjar
Member

Segment Don't Update Custom Contact Properties

hey wendy

after contacting with segment .Irina Gorelik from segment team wants to contact with you to work this problem out .

Ampjar
Member

Segment Don't Update Custom Contact Properties

so @WendyGoh  if possible do you have a direct contact so that Irina can CC you ?

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Segment Don't Update Custom Contact Properties

Hi @Ampjar,

 

Sure! Let me DM you.

0 Upvotes