Client-side access to contact data via JavaScript?

Hello there lovely IS Community :slight_smile:

Many marketing automation platforms identify users on the client side (when they click an email link etc) and store that information or let us store that information to track the user behavior, and use that for multiple reasons. With those platforms, is also possible to query the contact data marked as public through the client-side JS.

For example, one of those use cases would be to use an Intercom identify call to identify users directly and log their message via Intercom to their user profile directly.

From what I’ve been looking at, it’s impossible to get access to contact data from JavaScript on the client-side to do such tracking.

Is there a way to achieve that? And if not, is that in the pipeline?

Thank you so much ! :slight_smile:

Hi Adrien,

I’ve used intercom quite a bit in the past. Not being familiar with your particular setup, here are some quick thoughts:

If the infusion tracking script / infusion forms are used on the site, than there will be a cookie called contactId which stores the unique Infusionsoft Id for the contact. This could potentially be used within Intercom for the user_id.

Outside of that, if you need to access the email address or other details, it would take an API endpoint + AJAX / JavaScript. It’s certainly possible today, but would need custom development from a web developer.

Additionally, you could potentially on opt-in store some attributes in a cookie to later be leveraged for the intercom script when it runs. This would also be a little development.

hope it helps!

As @Mark_Price has pointed out, I regularly develop endpoints with PHP and then make a local AJAX call to the endpoint. The endpoint transports JSON back to the caller and then using JS, converts it to an object/array making it usable within the form.