HubSpot is a CRM platform with all the tools for marketing, sales, customer service, and content management. It is possible to integrate Reach with HubSpot, so that you could track conversions that happen with leads in HubSpot and pay publishers for them.
Before you begin
Tracking flow
Integration with HubSpot is performed with the help of the Reach pixel code.
The end-user clicks on your publisher's link on his source. Reach records the click related to the publisher and performs the redirect.
The end-user is redirected to your landing page. Reach JavaScript pixel code records the click_id in the cookies as rchclick.
The end-user browses over the landing and fills in a contact form. HubSpot creates a contact. Reach JavaScript pixel automatically adds rchclick to the contact properties.
The end-user proceeds over his life-cycle via some events. HubSpot sends postbacks to Reach, which contain rchclick. Reach finds a click with the matching ID and records a conversion for the relevant click.
Adding a Reach pixel code
Add the following pixel code to your landing page, where your tracking URL leads to, as well as to the webpage, where the HubSpot contact form is located:
<script src="https://clk1.reachclk.com/sdk/reach.js"></script> <script>
Reach.hsInit();
</script>
It should be added to the end of the pages' bodies and after the HubSpot form code.
Why you need a pixel code:
if there is a click_id parameter in the URL, it saves it to rchclick parameter of the browser cookies.
when HubSpot form is loaded, if there is a rchclick hidden field, the code fills in it with the value of the rchclick parameter, stored in cookies.
Setting integration on HubSpot
⚠️You need the administrator access for setting up integration on HubSpot.
Set up a property
Go to the HubSpot admin panel.
Go to the Contacts drop-down menu, the Contacts section.
Go to the Actions drop-down menu, and click Edit properties.
Click Create property.
Fill it in the following way:
Click on the </> icon. In the Internal name field, type rchclick, and click Save. Click Next.
Select the Field type as Single-line text, and click Create.
Add the property to the HubSpot form
Go to the Marketing drop-down menu, the Lead Capture section, Forms.
Select the form, which you want to add Reach to, and click Edit.
Let’s suppose that the existing form initially collects only emails. Search for the Reach Click ID and click the property.
Make sure that the field was added to the form. Select Make this field hidden, check the Hidden Field label on it and click Update.
Click Publish. If the form was already implemented on a website page, you don't need to proceed with any additional actions.
Set up a webhook in HubSpot
The next step depends on what an event (goal) which you want to track as conversions in Reach, is.
You may choose any conditions for a webhook to trigger, based on:
the properties (e.x. you can trigger it only for specific countries).
events (e.x. Lead status change).
Webhooks may be set for other entities (not only contacts) as well.
In the guide below you will see steps for this even: Contact form submitted. A Contact was created with the lead status New.
Go to Workflows.
Click the Create workflow drop-down menu, then click From scratch.
Select Contact-based, and click Next.
Click Set up triggers, and select Contact properties.
In the Contact properties field, type Reach Click ID and click on it.
Select the is known checkbox, and click Apply filter. The webhook will only work for the contacts that contain some value in the Reach Click ID field.
For Contact form submitted event click AND.
Select the Contact properties filter type.
Select the Lead status property.
Select is any of and New, and then click Apply filter.
Click Save.
Click the + icon.
In the Workflow side menu, click Send a webhook. Select the Post option.
You need to get a Reach postback link. It looks the following way:
https://psb1.reachaff.com/postbacks?click_id={CLICK_ID}&advertiser_id=your_advertiser_id_in_Reach
Apply the following changes to the link:
remove click_id={CLICK_ID}&
add /hubspot after postbacks
Add the goal, which you have in your campaign in Reach:
Go to your campaign in Reach
Go to the Goals tab
Find the goal you want to track and click the side menu, then click Edit.
Take the value from the Postback parameter value field.
Add it to the postback URL in the goal parameter.
So the modified link will look the following way:
https://psb1.reachaff.com/postback/hubspot?advertiser_id=your_advertiser_id_in_Reach&goal=lead
Take the link and enter it to the Webhook URL field on HubSpot.
Select Choose specific properties, and fill in the fields in the following way:
Reach Click ID: rchclick
Email: user_id (optional: it simplifies searching for related conversions in Reach).
Click Save.
Click Review and publish.
Select No, only enroll contacts who meet the trigger criteria after turning the workflow on, and click Turn on.
Perform the integration test
To make sure whether the integration is set up correctly, we highly recommend running the integration text. It is basically the test of the PIxel integration, so in this guide, you will see the example of the test specifically for HubSpot.
Create a click.
Go to your campaign, to the Tracking settings tab.
Copy your Example tracking link, and fire it in the address bar. ⚠️Take targeting restrictions into account.
Go to the Clicks statistics and check, whether the click was recorded.
Check whether the value of the click_id parameter from your tracking URL was recorded to rchclick in the browser cookies.
Create a conversion.
Check the contact properties on HubSpot.
Go to the HubSpot admin panel.
Go to the Contacts drop-down menu, the Contacts section, and click on the created contact.
Click View all properties.
Check the value of the Reach Click ID property.
Check workflow enrollments.
Go to the workflow, which you created. Click the More drop-down menu, and click View enrollments.
Check whether the contact, which you created, proceeded with this workflow.
Check the conversion on Reach.
Go to the Postback log and check the record.
Go to the Conversions statistics and check the very conversion. Click on it to see details. Check the user_id in the conversion.
Please contact Affise Customer Support team regarding all raised questions via the e-mail: [email protected].