1. Go to the Integrations page.
2. Choose the HubSpot integration and click 'Connect with HubSpot'.
3. Log in to HubSpot and click 'Choose Account' on your Hotjar account.
4. Click 'Grant Access'.
5. Customize your HubSpot integration.
You can send survey responses to HubSpot. Customize your setup by enabling or disabling this options in the Integrations tab.
6. Enable the filters on your HubSpot timeline.
7. Go to HubSpot. Open a contact's timeline and add the integration filter.
How do I share Session replay links with Hubspot?
In order to send your Session Replay links to Hubspot, you will need to add a custom code to your Hubspot account by following the steps below.
1. In Hubspot, go to 'Data Management' > 'Custom Events':
2. Click on 'Create an event'.
3. Select 'Code JavaScript'.
4. Add the details of your event (you can enter 'Contentsquare Replay' as the Event name).
5. Select 'Custom string property'.
6. Add a property name and an internal name exactly as written below: (this is to ensure it will work correctly).
Property name: Replay Link
Internal name: replay_link
7. Click on 'Next'.
8. In the default snippet provided by Hubspot copy the event name (pe261XXXXX_contentsquare_replay) as seen the example screenshot below and paste it in the CSQ code snippet below in place of the "ADD_YOUR_EVENT_NAME_HERE" value. Then simply replace the whole default Hubspot code snippet with the CSQ snippet including your event name.
CSQ code snippet:
/* *Name: Hubspot CS Integration *Version: 1.0.0 */ const eventName = "ADD_YOUR_EVENT_NAME_HERE"; let replayLinkSent = false; window._uxa = window._uxa || []; window._uxa.push(["onRecordingStateChange", onRecordingStateChange]); function generateReplayLink() { window._uxa.push(["replay:link:generate", { withTimestamp: false }, onReplayLinkGenerated]); } function onRecordingStateChange(context) { if (context && context.isRecording) { generateReplayLink(); } } function localStorageTasks(type) { if (type) { try { switch (type) { case "get": return localStorage.getItem("cs_replay_sent"); case "set": localStorage.setItem("cs_replay_sent", "true"); break; case "remove": localStorage.removeItem("cs_replay_sent"); break; default: return false; } } catch (error) { return false; } } } function onReplayLinkGenerated(context) { try { if (context && context.replayLink && context.isRecording && !replayLinkSent) { replayLinkSent = true; if (!localStorageTasks("get")) { localStorageTasks("set"); const replayLink = "https://" + context.replayLink + "&vd=hs"; _hsq.push([ "trackCustomBehavioralEvent", { name: eventName, properties: { contentsquare_replay_link: replayLink, }, }, ]); } } } catch (error) { return false; } } let afterPageViewCallbackRan = false; window._uxa.push([ "afterPageView", function (context) { if (!afterPageViewCallbackRan) { afterPageViewCallbackRan = true; if (context && context.pageNumber === 1 && localStorageTasks("get")) { localStorageTasks("remove"); generateReplayLink(); } } }, ]); //Hubspot CS Integration End
After you complete this step it should look like this:
8. Click on 'Done' and you are all set.
What a replay event looks like in a Contact Timeline once you have activated Contentsquare filters:
FAQs
Why don't I see any data in Hubspot?
The HubSpot integration works by detecting the hubspotutk cookie and reading it's value, which you can read more about on HubSpot's Knowledge Base.
The HubSpot UTK is set by the HubSpot tracking code, and it is a unique identifier for website visitors, which HubSpot can then connect with existing contacts.
Make sure that the HubSpot tracking code is being fired immediately on page load. This ensures that a HubSpot UTK is present before the survey response is submitted.
How do I remove the Hubspot integration?
1. In HubSpot, go to 'Marketplace' > 'Connected apps'.
2. Click 'Actions' on the Contentsquare integration and click 'Uninstall'.
3. In the dialog box, type uninstall in the text field and click 'Uninstall'.
4. Go to your Integrations page, and click 'Disconnect HubSpot integration'.