Sending Cookie consent data from a 3rd party cookie consent script in Wordpress to Hubspot

SOLVE
KimSanka
Member

Hi there,

 

My question is a bit more complex as the title suggests. I'll try to explain in short.

 

In our Hubspot account we are using two domains. Domain 1 is using the Hubspot Cookie consent banner. Apparently it is not possible to use a separate Hubspot cookie consent banner on both domains. Therefor we installed a 3rd party cookie consent script on domain 2.

 

We can not install Hubspot tracking code on our website on domain 2 because that will automatically show the Hubspot cookie consent banner which is meant for the website on domain 1.

 

One way or another we need to be able to send user cookie consent data to Hubspot from the website on domain 2 (which is a Wordpress website). Hubspot Support suggested us to use the HubSpot API.

 

I have worked with APIs in PHP from other sources but in this case I don't really know where to start. Can anyone point me in the right direction?

0 Upvotes
1 Accepted solution

Accepted Solutions
KimSanka
Solution
Member

We have figured out that the caching plugin (WP-Rocket) was removing the Business Unit ID from the trackiong code when the "Minify JavaScript files" option was activated. Deactivating "Minify JavaScript files" in WP-Rocket solves this issue.

View solution in original post

5 Replies 5
dennisedson
Community Manager

@KimSanka ,

@miljkovicmisa  is a wizard and will probably be able to help you out

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
miljkovicmisa
Top Contributor | Gold Partner

👋@KimSanka .
First of all, you are able to add multiple cookie policies in your account, and choose which one is for which domain. this is extensively documented right here in this link.
This should get you covered with having differrent cookie concents on differrent domains.

So to answer clearly: You are able to add two differrent conscents for two differrent websites. This link has you covered on that.

 

If that doesn't cover your needs for some reason, you should write here what exactly is the issue, because if you must use the third party tool on that second website, things are getting very complicated, firstly because hubspot has it's own system of categorizing cookies, that is documented in this link. Secondly because the third party concent should manipulate the hubspot cookies, but this is not possible without the tracking code.

P.S.: The api that support was talking about is the tracking api and is only valid if the tracking code is present in the page. The full documentation on the api can be found here.

 

P.P.S.: thanks for the shoutout @dennisedson !

If my answer was helpful please mark it as a solution.

KimSanka
Member

Thanks you very much for your reply.

 

We are still in comunication with hubspot Support and this morning I received verification that what we are experiencing is unexpected behaviour.

 

We would prefer to use Hubspot's cookie consent banner, we just installed the third party once because we understood what we wanted to do with the two websites was not possible. Aparently this is not the case.

 

If I'm not mistaken we have a call planned on monday with someone at Hubspot to clear it all out. so I'm hopefull it will be fixed and we will be able to inegrate our cookie policy with Hubspot fully in time. Hopefully a short one 😉

 

Thanks again!

 

 

0 Upvotes
dennisedson
Community Manager

@KimSanka ,

Let us know what you find out 😁

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
KimSanka
Solution
Member

We have figured out that the caching plugin (WP-Rocket) was removing the Business Unit ID from the trackiong code when the "Minify JavaScript files" option was activated. Deactivating "Minify JavaScript files" in WP-Rocket solves this issue.

View solution in original post