QR Codes best practice

If you are using QR codes in any type of offline marketing, then it would be a good idea to have some way of tracking these users that come onto your website. One quick way is to achieve this via a HTTP redirect. This redirect would then push people to the right page with some extra tracking code tacked on the end of it. QR readers generally display the destination URL when they decode the QR code, and having something long and complicated may hinder you users from visiting.

One further advantage of bringing users to a QR code with a redirect, is that you can easily change the URL in the future if the campaign changes, or is no longer open. Here you would have the option to show a special notice, or redirect again to a newer campaign.

Code to track QR codes

This code will allow you to track users in Google Analytics by what medium they came from, and you will be able to segment them based on this usage. Below is the code located at http://www.blackdog.ie/q/index.php.

<?php
//////
// Fill out and change
//////
$url = "http://www.blackdog.ie/"; // your website name
$medium = "QRcode"; // type of marketing medium
$campaign = "NewsPaperAd"; // name of your campaign
$content= "ad1"; // use to differentiate different ads
$source= "IrishTimes+QR+code+redirect"; // name of your source publication
$term = ""; // if you are focusing on keywords
//////
// That's enough editing
//////

// no need to edit below
$builtURL = $url."?utm_medium=".$medium."&utm_campaign=".$campaign.
"&utm_content=".$content."&utm_source=".$source."&utm_term=".$term;

header("HTTP/1.1 301 Moved Permanently");
header("Location: $builtURL");

exit; // Closes further script execution .

?>

Test this URL


This should bring you to :

  1. http://www.blackdog.ie/q/ which will redirect you to
  2. http://www.blackdog.ie/blog/qr-codes-practice/, our post about QR codes, and it will also append the Google Analytics code to track people in the URL.

Create your own QR code for free

There are a few companies out there selling QR codes, probably to business who don’t really understand the technology. There is a free way to generate your QR code, just visit this website and enter the details of the destination URL.

If you have any other tips for business using QR codes, please share them with us in the comments.

P.S. : if you are doing any offline marketing then remember to put a QR code on your flyer, brochure, packaging, etc.

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>