Skip to main content

Personalised images in HubSpot

Use OKZest with HubSpot to show each contact an image with their own details, such as their first name or company. HubSpot replaces its personalization tokens for each contact when it sends, and OKZest builds the image from those details.

You need: an OKZest account with a saved design that has at least one dynamic text layer, and a HubSpot marketing email with contacts who have the details you want to show.

1. Know the HubSpot token​

HubSpot calls its merge tags personalization tokens. In HTML, a token is written as the object name and the property's internal name inside double curly brackets, for example {{ contact.firstname }}. Custom properties use their internal name in the same way.

HubSpot's default value is only used when the contact has no value for that property. If you set no default, the token is left blank. Leave a space between text and a token so the line does not run together when the value is empty.

Source: HubSpot Knowledge Base: personalize your content.

2. Use the token in your design​

  1. Open your design in OKZest and select the dynamic text layer.
  2. In Text settings, enter a short ID, such as first_name.
  3. In Merge tag, enter {{ contact.firstname }}.
  4. Enter Default text, such as there, then save the design.

See Merge tags for the full list of formats, and the email quickstart if you have not made a design yet.

3. Copy the image code from OKZest​

  1. In OKZest, select Share.
  2. Under Embed your image, select Copy <img>.
  3. If a yellow Some merge tags are missing box appears, type {{ contact.firstname }} into it and select Save changes, then copy the code again.

The image address looks like this, where first_name is your layer ID:

https://media.okzest.com/img?c=YOUR_COMPANY_ID&i=YOUR_DESIGN_ID&first_name={{ contact.firstname }}

4. Add the code to your email​

HubSpot's standard image module takes a fixed picture and does not read tokens in its address. Put the code in a module that accepts HTML instead:

  1. Open your marketing email in the editor.
  2. Add a custom code or HTML module where the image should go. Which modules are available depends on your HubSpot plan and email template.
  3. Paste the <img> code from OKZest and save.

HubSpot community members report that a personalised image can appear in the preview but not in the delivered email, so test with a real send.

5. Send a test​

  1. Send a test email to a contact record with a first name.
  2. Open it and check the image shows that name. If the contact has no first name you see your default text.

If it does not work​

  • The image shows the default text for everyone. Check the token's internal property name in HubSpot. It is lower case, such as firstname.
  • The image does not appear. Confirm that your email has a module that accepts custom HTML, and try again with a test send rather than the preview.
  • A broken image appears. Paste the image address into a browser, replacing the token with a real name such as first_name=Sam. If it loads, the design is fine and the problem is how the code was pasted. See the troubleshooting page.

What next​