Skip to main content

I am trying to send a rich link in the metadata of a custom event triggered with the intercom-go package.

 

In intercom’s dashboard, it reaches as aObject Object]. Is there any different input format expected for rich links in go, or is it just not supported?

 

	event := intercomlib.Event{
UserID: userId,
EventName: eventName,
CreatedAt: int64(time.Now().Unix()),
Metadata: map string]any{
some_rich_link: map string]any{
"url": "https://www.some-custom-url.com",
"value": "some-custom-name",
},
},
}

ic.Events.Save(&event)

 

Hey @Júlio Cordeiro 👋🏼
 

To send a rich link in the metadata of a custom event using the Intercom Go package, you should structure the metadata to include a URL and a value. The correct format for sending a rich link is to use a map with "url" and "value" keys. Here is an example of how you can format the metadata for a rich link:

event := intercomlib.Event{
    UserID:    userId,
    EventName: eventName,
    CreatedAt: int64(time.Now().Unix()),
    Metadata:  mapstring]any{
            "order_number": map string]any{
            "url":   "https://example.com/tx186373",
            "value": "TX186373",
        },
    },
}
ic.Events.Save(&event)


In this example, "order_number" is the key for the rich link metadata, and it contains a map with "url" and "value" keys. The "url" key should have the link you want to send, and the "value" key should have the text that will be displayed and linked in the Intercom dashboard. Ensure that the keys in your metadata do not contain any invalid characters such as periods ('.'), dollar signs ('$'), characters like ~`!@#%^&*'{}|\'" or the NULL character.

Learn about event tracking here

Let me know if the above helped 😁


Reply