Personalising QR code URLs with customer or order data

How to build QR code URLs using dynamic data

Introduction

Penny Black has the ability to generate dynamic URLs for QR Codes using information from your orders and customers. This may allow you to take the customer to a page or app tailored to them, continuing their personalised experience.

Examples include adding a personalised promo code to the URL which will apply automatically, or including the customer’s name in the URL to show a personalised landing page.

How it works

You can use the same order info that you use in segments and campaigns in dynamic URLs (including info from marketing integrations such as Klaviyo).

When configuring a QR code in a campaign, you can add variables surrounded by curly brackets ‘{}’, e.g. {customer.first_name} to make the URL dynamic.

When setting up a campaign, this could look like the below:

When creating the PDF for new orders for a campaign, we substitute the variables in the curly brackets with the actual values from the order, like the customer's first name.

If you wish to use data from a third party (e.g. Klaviyo), you can do this by specifying the attribute in the variable name, e.g. {customer.klaviyo.profile_id}

If you have pre-configured URLs in your data, you can substitute the entire URL for a single variable:

Variable names

Built-in variables that you can use are:

  • customer.first_name
  • customer.last_name
  • customer.full_name
  • customer.email
  • customer.language
  • external_order_name (the customer-facing order number)
  • external_order_id (the internal ecommerce platform order id)
  • order.billing_city
  • order.billing_postcode
  • order.billing_country
  • order.shipping_city
  • order.shipping_postcode
  • order.shipping_country
  • promo.code (see below)

In addition, you can use order attribute fields for both order and customer, which exist under order.attributes. and customer. respectively.

Using personalised promo codes in your URLs

If you’re using Penny Black to generate personalised promotional codes for your campaign in one of the other fields, you can also embed this into the URL if required using {promo.code} .

💡 Note that this only works if you’ve displayed the promo code in one of the other fields.

There are other help pages in this section for more specific examples of using dynamic variables in QR codes.

Caveats

If the data required from an order is missing or invalid and doesn’t result in a usable URL, we will not match this order to the campaign and it will be skipped to try and match other campaigns.

Similarly, be careful when typing in these variables to make sure their names are correct. We suggest testing a campaign with a preview from a real order which you know has the desired information to ensure it populates properly.