Drupal Website and HubSpot Integration

Hi there, I would like to ask if anyone has experience with a Drupal website and HubSpot integrations, either via the Hubspot module or via Zapier. I would like to understand the pros and cons of both options. Thanks

I’ve had a Drupal website before but I’m not sure of the integration you are talking about with Zapier. What are you trying to integrate? When I’ve done this before I would just include the Hubspot code and embed forms where needed on the site.

For now, we want to be able to build landing pages, forms, CTAs, etc. in HubSpot and connect them with our new Drupal website. I understand that we can connect via the Drupal module or via Zapier, a third-party platform with the ability to integrate tools without extensive technical development. Considering future scalability and having the flexibility in-house, without the need for external technical agency resources, I would like to understand which approach would be the best here, e.g if we want to connect in the future other tools, functionalities, making changes, etc. Thanks

First, the Drupal module is similar to the Wordpress plugin. There is nothing about landing pages or CTAs here. It basically gives you an alternative way to embed the tracking code and, if you are using the web form module, it creates a way to link via the API from your webform to the Hubspot form. This is what I referred to before, as the Drupal instance I worked with we had been using the Google Tag Manager to deploy our Hubspot tracking code which made this plugin redundant. In addition, we just used the embed code from Hubspot directly into our Drupal page content as opposed to the webform module.

As far as landing pages and CTAs are concerned, the landing pages are all hosted in Hubspot, they do not have the option to be embedded or used within Drupal or any CMS, that is not their intention. With CTAs, that is just a code snippet for a tracking link that you can put anywhere in your site.

Personally speaking I try to avoid too many modules/plugins on websites where it can be avoided as sometimes they can cause conflicts with one another and can cause confusion if you are deploying code inclusions via module on some vs. a tag manager on others. I would review your current setup of how you are deploying tags and forms within Drupal to see whether this makes sense to use the module makes sense for your instance.

As for the Zapier piece, the limited actions (2) that can be performed in Drupal need to have use in your business for this to make sense. Personally speaking we never ventured down this route as the Zapier connection provides limited options.

Ben, thank you for your help.

The HubSpot-Drupal connector is now live in the HubSpot Marketplace and is free to use. HubSpot Marketplace

Hey @MiriamL,

@Ben_M gave you a perfect explination - just wanted to add one little trick/idea:

If you want to stick with Drupal, you can build your own landing pages with it. To get HubSpot forms into Drupal more “user-friendly” (not dealing with the embed code everytime), you can create your custom Drupal block, call it “HubSpot forms” (name is up to you) and look into this Drupal doc.

My personal approach for such a block would be to insert the embed code into this module once add a text input (not rich-text) for the actual HubSpot form ID and you’re ready to go. :slight_smile:

Just an example for such a Drupal block.

module.html.twig (if you’re using the new HubSpot form builder)

<div class="hsForms">
<script src="https://js-eu1.hsforms.net/forms/embed/developer/123456789.js" defer></script>
<div class="hs-form-html" data-region="eu1" data-form-id="{{hubspot_form_id}}" data-portal-id="123456789"></div>
</div>

module.html.twig (if you’re using the HubSpot legacy forms)

<script charset="utf-8" type="text/javascript" src="//js-eu1.hsforms.net/forms/embed/v2.js"></script>
<script>
  hbspt.forms.create({
    portalId: "123456789",
    formId: "{{hubspot_form_id}}",
    region: "eu1"
  });
</script>

for both examples: replace the “123456789” with your actual HubID; the {{hubspot_form_id}} is the drupal text field name.

Such approach allows you to simply copy/paste the HubSpot form ID into a text field, without dealing with the embed code everytime. This might be extremly helpful, if you’re modifying the embed code to get more out of it. Like disabling the HubSpot form styles for legacy forms

best,
Anton