Implementing QR codes and barcodes

Engage has an online tool for the generation of QR and barcode images which can then be sent out in customer emails.

Such an image could encode something personal like a member number (for easier identification), a personal reward voucher number or an order number. These images could then be used by an external system, like a POS, to easily pass information directly from a customer’s mobile phone screen.

Using the code image generator

To generate a barcode or QR image, you manually build an image URL like the one below, but with VALUE replaced by whatever you want to encode into the image.

https://barcode.voyado.com/bar?v=VALUE

As VALUE you must use a contact personalization field, like a contact’s member number. Using anything else as the “v“ parameter will only generate a code image with VALUE replaced by “SAMPLE”.

This is the correct format to use:

https://barcode.voyado.com/bar?v=[[contact.memberNumber | barcode]]

The “| barcode” part after the personalization field name is required. It is the “family name” for barcodes and QR codes in Engage.

Also note the “bar“ path in the URL, right before the question mark. Using "bar" generates a linear barcode. Using “qr“ in the path instead generates a QR code. In that case, your URL will look like this:

https://barcode.voyado.com/qr?v=[[contact.memberNumber | barcode]]

This is how you specify which kind of barcode you want, a linear or a QR code.

NOTE: This solution does NOT support static code images that are the same for every user. Only code images containing a personalised attribute for the contact who is receiving the message will work.

 

Using an URL with a personalized field

You can create a barcode that encodes a personalized field together with an URL in this way:

https://barcode.voyado.com/bar?v=[[contact.Id | barcode]]&prefix=https://digitalwallet.voyado.com/pass/download/123456/

This example will cause an URL like this to be encoded:

https://digitalwallet.voyado.com/pass/download/123456/cd11a4ec-0c42-46a1-b53a-99d02933329e 

Where the value at the end is the contact's GUID. 

Entering the URL

When building an email in Engage, paste the URL you’ve made into the editor as an external image URL.

163e5133a0141e.png
When an email is actually generated, the contact’s data will then be automatically inserted and a barcode or QR image encoding that specific data will be returned and embedded into the email.
 
You’ll never need to go to https://barcode.voyado.com manually. If you do paste your image URL into a browser, you’ll only see a sample image like above. This is to prevent external parties from using our encoding tool.

Inserting your contact's data

Any of a contact’s personal fields can be used as VALUE. For example:

Email:
https://barcode.voyado.com/bar?v=[[contact.email | barcode]]

Mobile phone number:
https://barcode.voyado.com/bar?v=[[contact.mobilePhone | barcode]]

Latest reward voucher number:
https://barcode.voyado.com/bar?v=[[contact.latestcheck.code | barcode]]

Contact external ID:
https://barcode.voyado.com/bar?v=[[contact.externalid | barcode]]

CAUTION! The “v” parameter must consist of a contact's personal fields.

Other parameters

The value “v” is a mandatory parameter and must always be used. There are also several other parameters you can add to adjust the form of the barcode (or QR code) returned. Example:
https://barcode.voyado.com/bar?enc=code93&w=300&c=ff0000&v=[[contact.memberNumber | barcode]]

Or, if making a QR code image with the same data:
https://barcode.voyado.com/qr?enc=M&w=300&c=ff0000&v=[[contact.memberNumber | barcode]]

Another option to specify a prefix which will be placed before the value of the personal field:
https://barcode.voyado.com/qr?v=[[contact.mobilePhone | barcode]]&prefix=%2B

In this case the prefix is "+" which can then be displayed before the mobile number, for example. Note that the prefix you give must be URL-encoded.
 
Below you can see all the parameters you can use in the image URL:

Parameter Description Values

v*

The value to be encrypted and stored in the image

String of letters and/or numbers from a personalization field

enc

Used for both barcodes and QR codes but in different ways.

See below

...

For barcodes it’s the encoding.

code128 (default)

code93

upca

upce

ean13

ean8

...

For QR codes it’s the Error correction level**

L, M, Q (default), H

w

Width in pixels

300 (default)

h

Height in pixels (Not used for QR code)

100 (default)

c

Color as a hexadecimal

000000 (default black)

bg

Background color as a hexadecimal

ffffff (default white)

prefix

Some prefix that can be placed before the personal field value

For example, %2B, which is the character "+" URL-encoded.

* This is a mandatory parameter

** QR codes can be damaged or dirty but still be read. An error correction adds more pixels to the QR code to enable it to be restored if needed. The scale goes from low to high: L, M, Q, H.

Values

QR codes can store any textual value, for example a member number, an email address or a URL. Barcodes, however, are a bit more limited. See the table below for type of value and data.

CAUTION! The URL defined in the image field in the email module is not in any way related to the value that the QR code or barcode will contain. The image will only contain the value of the “v” parameter.

The following coding standards, commonly used in retail, are supported:

Coding Value Limits

UPC-E

Numeric

6 digits*

UPC-A

Numeric

11 digits*

QR

Alphanumeric

1-4096 characters

EAN-8

Numeric

7 digits*

EAN-13

Numeric

12 digits*

Code 128

Alphanumeric

1-128 characters, (A-z)

Code 93

Alphanumeric

Unlimited number of characters, (capital letters A-Z)

* An extra check digit will be added at the end when a barcode is generated.
 

Width and height

The physical size of the barcode or QR code can be set to match the layout of the email. A quiet zone (space) will always be added around the code to let scanners read it. Be careful when scaling codes; they can’t be too small as the number of pixels on the phone’s screen may not be sufficient to represent the code.

Always verify that your code is working by using real scanners.

Colors

Scanners function best with high contrast so be sure to have a good contrast between the color and the background. Verify the code by the use of real scanners.

Preview the code

The URL will only show the actual code image when the email is previewed using a selected contact, or in a sent email. When emails are created in the email editor, the code will only display a general sample.

Scanning

There are different scanners available and not all of them can handle all codes, or successfully scan all phone screens. Again, to be sure you should verify the code by the use of real scanners.

The scanner will send the value stored in the code to the connected system. Many scanners emulate a keyboard when sending a value to a connected system. There is no logic stored in the code so the receiving system needs a way to know what this value represents and how to process it.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.