Wiki source code of Hubspot Integration Setup

Last modified by Admin User on 2026/04/08 10:22

Show last authors
1 **HubSpot Integration:**
2
3 HUBSPOT: API SETUP
4
5 The API in Hubspot is called a Private App. To give ONEcount access to your Hubspot installation, you to create a private app called "ONEcount Integration" with the following scopes:
6
7 contacts ~-~-> read, write,
8 lists ~-~-> read,write
9 company ~-~-> read write
10 content → read, write
11 remaining all read
12
13 [[image:hubspot-integration_e2fc744571ec77a0.png||height="307" width="665"]]
14
15
16 [[https:~~/~~/developers.hubspot.com/scopes>>url:https://developers.hubspot.com/scopes]]
17
18 Here is documentation from the Hubspot site on how to do it: __[[https:~~/~~/developers.hubspot.com/docs/api/private-apps>>url:https://developers.hubspot.com/docs/api/private-apps]]__
19
20 Once you have created this in HubSpot, send us the Access Token for this private app and ONEcount will be able to pull your enagement data. The token will look like this:
21
22 EXAMPLE: vat-ma1-936fe9d7-d41b-4bb6-91e2-d82c951exxde
23
24 Please note that Hubspot accounts have a limit on the number of API calls you can make. ONEcount typically makes 10 to 20 calls per day to fetch engagement data. In addition, each time a user is added to your Hubspot lists (either individually through a web sign-up or in bulk through a bulk operation), we make an API call. In addition, when a user who is unknown clicks on an email link, we will make an API call to look up that user in your database.
25
26 As a practical matter, you should not exceed your Hubspot limits, however during the first month or so of deployment, please monitor your usage to avoid fees from Hubspot.
27
28 **Embedding Contact Email in HubSpot Campaign URLs**
29
30 //Using personalization tokens to pass email as a URL parameter//
31
32 Tags: Marketing Email · Personalization · URL Parameters
33
34
35 = **Embedding Contact Email Token in Campaign Links** =
36
37 HubSpot supports embedding contact property values — including email address — directly into link URLs in marketing email campaigns via personalization tokens. This enables use cases like pre-populating landing page forms, passing identity to third-party tools (such as ONEcount), or building personalized redirect flows. ONEcount can use these tokens to identify users who click on links that connect them to your web site.
38
39 By reading the email address token from the URL, ONEcount can connect a visitor clicking on an email link to a record in your database.
40
41 Tokens follow the syntax ~{~{contact.property_name}}. The contact's value for that property is substituted at send time.
42
43
44 = **Methods** =
45
46 |(((
47 **Method 1 — Recommended**
48
49 **Token directly in link URL field**
50
51 In the email editor, paste the full URL including the token into the Link URL field of any button, text link, or image. HubSpot resolves the token at send time.
52
53 https:~/~/yoursite.com/landing
54
55 ?email=~{~{contact.email}}
56
57 &fname=~{~{contact.firstname}}
58
59 //UI alternative: in the Link URL field, click Personalize → Type: Contact → Token: Email.//
60 )))
61
62
63
64 |(((
65 **Method 2 — HTML Source**
66
67 **Inline hyperlink via HTML editor**
68
69 For embedding the token inside body text (rather than a button), switch to HTML source view and construct an anchor tag manually:
70
71 <a href="https:~/~/yoursite.com/?email=~{~{contact.email}}">
72
73 Click here
74
75 </a>
76 )))
77
78
79
80 |(((
81 **Method 3 — Workflow property**
82
83 **Pre-built URL via workflow (automated emails only)**
84
85 For complex URLs or automated email flows, use a workflow Set property value action to build the full URL string into a contact property using token concatenation, then reference that property in your email template.
86
87 ~{~{contact.custom_landing_url}}
88
89 //Requires Marketing Hub Professional or Enterprise.//
90 )))
91
92
93
94
95 = **Passing Email to ONEcount** =
96
97 To pre-identify a contact arriving at an ONEcount-gated page or registration form from a HubSpot campaign, append the email token as a query parameter. ONEcount can read this parameter to skip the identification step or pre-fill registration fields.
98
99 |(((
100 https:~/~/yourpublisher.com/article
101
102 ?oc_email=~{~{contact.email}}
103
104 &oc_fname=~{~{contact.firstname}}
105
106 &oc_lname=~{~{contact.lastname}}
107 )))
108
109
110
111 **Note: **Email addresses are URL-encoded at send time (e.g., user%40example.com). Ensure the receiving ONEcount endpoint decodes the parameter before lookup.
112
113
114
115 = **Important Caveats** =
116
117 |**Caveat**|**Details**
118 |**Contact must be known**|Tokens only resolve for contacts with a CRM record and a populated value for the property. Unknown contacts receive the fallback value you configure.
119 |**URL encoding**|The @ symbol in email addresses is encoded as %40. Receiving systems must URL-decode the parameter before use.
120 |**Use text properties in URLs**|Dropdown/picklist field values may not resolve correctly in URL contexts. Use single-line text properties for any value embedded in a URL.
121 |**Automated emails require Pro+**|Personalization tokens in automated (workflow) emails require Marketing Hub Professional or Enterprise. Regular campaign emails work on all plans.
122
123
124
125
126