Solved

Not able to sync nested fields under object in Intercom

  • 24 April 2024
  • 3 replies
  • 38 views

We are syncing fields nested under the object to Intercom, but it seems it is not working.

we have the following tracking plan for Identify and Group calls.

For the Identify call, we are trying to sync the pickupOutsourcingEnabled field, which is under the settings object. To enable this sync in Intercom, we updated the filters and created a Transformation to move the property to the root level.

Although we are not encountering any errors in the Event delivery when sending fields to the Intercom destination, we are unable to see the field in Intercom.


Group Call Tracking plan

{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"labels": {},
"properties": {
"context": {
"id": "/properties/context"
},
"traits": {
"type": "object",
"properties": {
"settings": {
"description": "Buyer company settings.",
"id": "/properties/traits/properties/settings",
"properties": {
"pickupOutsourcingEnabled": {
"description": "True, if Pickup outsourcing is enabled for the company.",
"id": "/properties/traits/properties/settings/properties/pickupOutsourcingEnabled",
"type": "boolean"
}
},
"required": [
"pickupOutsourcingEnabled"
],
"type": "object"
}
},
"required": [
"settings"
],
"id": "/properties/traits"
},
"properties": {
"type": "object",
"id": "/properties/properties"
}
},
"required": [
"traits"
]
}

Identify Tracking plan:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"labels": {},
"properties": {
"context": {
"id": "/properties/context"
},
"traits": {
"type": "object",
"properties": {
"company": {
"description": "Company details.",
"id": "/properties/traits/properties/company",
"properties": {
"settings": {
"description": "Buyer Settings",
"id": "/properties/traits/properties/company/properties/settings",
"properties": {
"pickupOutsourcingEnabled": {
"description": "True, if Pickup outsourcing is enabled for the company.",
"id": "/properties/traits/properties/company/properties/settings/properties/pickupOutsourcingEnabled",
"type": "boolean"
}
},
"required": [
"pickupOutsourcingEnabled"
],
"type": "object"
}
},
"required": [
"settings"
],
"type": "object"
}
},
"required": [
"company"
],
"id": "/properties/traits"
},
"properties": {
"type": "object",
"id": "/properties/properties"
}
},
"required": [
"traits"
]
}

Transformation:
I have moved property to root level, using JSONPath.

{
"data": {
"transformation": {
"if": "type=\"identify\"",
"propertyDrops": [],
"propertyRenames": [
{
"oldName": "company.settings.pickupOutsourcingEnabled",
"newName": "company.pickup_outsourcing_enabled"
}
]

}
}
}

 

icon

Best answer by Andrew Rawson 2 May 2024, 16:44

View original

3 replies

Important question: Is this instrumentation in question client-side (analytics.js), or via one of Segment’s server-side libraries? I’m guessing client-side? Also, how are you implementing that JSONPath method?Probably need to confirm that to give you a real answer.

But yeah, Intercom doesn’t support nested user/company traits, and will just drop those if it encounters them without returning an error. The one exception to that rule is the `company` object which you’re required to include under `identify.traits` in order to associate a user with a company in Intercom.

A few other thoughts based on my experience setting up/troubleshooting our Segment-to-Intercom integration(s), which also uses the b2b features, in case they’re helpful:

First - Assuming this code is client-side, are you using Segment’s middleware functions to implement that JSONPath transformation? That’s how I’ve handled cases where I needed to do a transformation to the identify object for a single, device mode destination like Intercom.

Second - Maybe I’m misinterpreting the “Group Tracking Plan” above, but it looks like your `group` method is missing a top-level `groupId` field?

Third - This is a bit bigger picture, but for whatever it’s worth, here’s a bit about how we’ve implemented Segment for Intercom. We actually only pass a couple traits to the identify.traits.company object, the account’s groupId and name, because that’s all that’s really needed to create the company object in Intercom and connect the active user to it. We pass all other account traits to the `group` request. In our case, we don’t actually send any `group` requests client-side, we largely send those server-side as part of a daily scheduled job -- with some exceptions, such as when a company is first created, when it’s subscription status/plan changes, etc (situations where a realtime update is critical for messaging purposes). Dunno how/whether this info applies to your situation … but maybe having those tracking responsibilities divided up between methods and/or sources could simplify the instrumentation?

 

We are segment APIs to push events like `Identify` and `Group` Calls.

First - Assuming this code is client-side, are you using Segment’s middleware functions to implement that JSONPath transformation? That’s how I’ve handled cases where I needed to do a transformation to the identify object for a single, device mode destination like Intercom.

 

For JSONPath transformations, we are using Segment UI.  Destinations filters and Tracking plans are being used by Segment UI only. we just call Identify and Group API to sync them to Intercom.

 

Second - Maybe I’m misinterpreting the “Group Tracking Plan” above, but it looks like your `group` method is missing a top-level `groupId` field

All other Group and Identify fields are being synced in Intercom, here I have mentioned required fields only. Other fields are omitted.

We have same settings in Segment Sandbox(Transformations, Destination filters) and Production Segment. fields are synced in Sandbox, but fails to sync in Production.

Hi @Sagar Viradiya

Saw that you had opened a support ticket and it appears the issue is resolved. If I understood the ticket correctly, it appears the field that wasn’t syncing in the Identify call was because a “parent” object was being blocked but that has since been rectified.  

I’ll go ahead and mark this as resolved and if you have other follow up questions feel free to add them here! 

 

Reply