RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.69% (5.89%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.69% (5.89%*) • Investment IO: 5.74% (6.40%*) • Investment PI: 5.49% (6.27%*)

Include QR Codes on Your Website

Include QR Codes on Your Website

A QR code (or Quick Response Code) is the trademark name for a matrix two-dimensional barcode that holds far more information than traditional, linear Universal Product Code (UPC) barcodes most commonly used on general consumer products. QR Codes were invented in 1994 by the Denso Wave automotive manufacturing company in Japan (a subsidiary of Denso Corporation that deals specifically with tracking and scanning technologies) to track vehicles during manufacture, and allow high-speed and accurate component scanning. QR codes now are used in a much broader context, including both commercial tracking applications and convenience-oriented applications aimed at mobile-phone users (termed mobile tagging).

Note: This feature may be migrated to the BeliefMedia Platform by the end of 2020. At that time access will be limited to clients only.

Conventional UPC-style barcodes are capable of storing a maximum of approximately 20 digits. QR Codes, however, can encode up to 7,089 characters (or roughly 3KB of data) in one symbol. Since the codes were designed for the automotive industry, they were conceived with the inevitable wear and tear in mind. If damaged, up to 30% of codewords, depending on the defined Error Correction, can be restored.

Denso Wave

Denso Wave made the decision to make the specifications of the QR Code publicly available very early on in the development phase so that anyone could use it freely. Although Denso retained the patent rights to the tech, it declared that it (generally) would not exercise them. This policy was in place from the very beginning of the code development, honouring the developers' intent that the QR Code could be used by as many people as possible. Thus the QR Code, which could be used at no cost and without worrying about legal entanglements, grew into a public code used by people all over the world.

QR Code Relevance in Consumer Marketing

It's likely you've seen QR codes on consumer products without specifically knowing what they're called. They're often used to direct consumers to websites, competition pages, videos, and other relevant online destinations or offline text messages. Some business people use QR Codes on the back corner (or elsewhere) on business cards so they might be scanned to return populated contact information. Their apparent widespread adoption aside, much research suggests that they're dying a slow death and will invariably end up in the tech-wasteland alongside Betamax and pagers. Research conducted in 2012 claimed that "... 97% of consumers don't know what a QR Code is". The linked article went on to say that "... most consumers are unsure which app to use to read a QR Code, or how to search for an app to read one".

Ask a fish to climb a tree and it'll tell you to fuck off. It's this same principle that applies with certain tech-based marketing surveys (I think my dad still thinks Google owns the Internet). QR Code relevance in marketing can't be determined by a general consensus; the percentage of people that are familiar with the term "QR Code" is often quite high, but it's the undefined "most consumers" that Holtzclaw refers to in his article that isn't nearly as high as his fuzzy brain might like to believe. Even in 2012, I don't think Eric foresaw the ubiquity of smartphones and the effectiveness of consumer-facing handset marketing. Applications like Snapchat, Messenger, and Kik all now integrate the tech, and many food manufactures are now starting to use the codes as standard. Even Amazon is starting to print QR codes on its packaging. The Google Chrome browser now integrates built-in scanning functionality which you can access via various means. Bottom line: QR Codes are relevant if you make them relevant.

Our own use of QR Codes suggests that they absolutely have a place in marketing... if used correctly. It's this strategic usage that led us down a path that had us include various QR-related tools in our (client) media management system.

RIP QRimg

Until a few hours ago, we operated a website  at QRimg that served over 250,000 QR codes a day - and that number was growing on a weekly basis. We made a decision to retire a number of our websites early this year... and QRimg was next on the list. Operating a free website isn't without its challenges... not the least of which is the constant barrage of feature requests demands from less than appreciative users. While the consumer-facing forms will make their way into our tools area sometime soon, the new API is tested and available now.

If you're a user of the former QRimg API, access will continue until September 26th of this year.

Google Charts QR Code

If you're after unrestricted access to basic codes, Google provides an excellent service. We've provided a PHP function here and shortcode function here that make use of their Charts API. While the Google API is deprecated, it will continue to work as per Google's support policy.

PHP Function

The new API requires a specific format depending upon the type of QR code requested. The one commonality in all URI formats is the base_64(ish) encoded text that forms the image name. A fully constructed request looks as follows: http://api.beliefmedia.com/qr/{size}-{error_correction}-{border}/{bg_color}-{foreground_color}/{encoded_url}.png. A simple request for a code with default values is simply http://api.beliefmedia.com/qr/{encoded_url}.png.

1
<?php 
2
/*
3
 Include QR Codes on Your Website
4
 http://www.beliefmedia.com/qr-codes-website
5
*/
6
 
7
function beliefmedia_qr_url($url, $html = false, $args = '') {
8
 
9
   if ($url == '') return false;
10
   $url = str_replace(array('+', '/'), array('-', '_'), base64_encode($url));
11
   $atts = array('size' => '200', 'ec' => 'h', 'border' => '1', 'bg' => 'ffffff', 'fg' => '000000', 'style' => 'display:block; margin-left: auto; margin-right: auto;');
12
   $atts = (empty($args)) ? $atts : array_merge($atts, $args);
13
   $result = 'http://api.beliefmedia.com/qr/' . $atts['size'] . '-' . $atts['ec'] . '-' . $atts['border'] . '/' . $atts['bg'] . '-' . $atts['fg'] . '/' . $url . '.png';
14
 
15
 /* Return QR Code link */
16
 return ($html !== false) ? '<div style="width: ' . $atts['size'] . 'px; ' . $atts['style'] . '"><img src="' . $result . '"></div>' : $result;
17
}
18
 
19
/* Usage */
20
$url = 'http://www.beliefmedia.com/';
21
$args = array('size' => '500', 'ec' => 'l', 'border' => '1', 'bg' => 'ffffff', 'fg' => 'ff0000');
22
echo beliefmedia_qr_url($url, $html = true);

If you're a client, an apikey should also be passed to the function in the arguments array; this ensures your access won't be metered. The Boolean html argument determines if a URL link is returned or a full-constructed image with basic style applied.

WordPress Shortcode

While a feature-rich WordPress plugin is forthcoming, the shortcode may be used in the meantime.

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin.

1
<?php 
2
/*
3
 Include QR Codes on Your Website
4
 http://www.beliefmedia.com/qr-codes-website
5
*/
6
 
7
function beliefmedia_qrcode($atts) {
8
 
9
  $atts = shortcode_atts(array(
10
    'url' => 'http://www.beliefmedia.com/',
11
    'apikey' => 'beliefmedia',
12
    'size' => '200',
13
    'ec' => 'h',
14
    'bg' => 'ffffff',
15
    'fg' => '000000',
16
    'border' => '1',
17
    'style' => 'display:block; margin-left: auto; margin-right: auto; padding: 20px'
18
  ), $atts);
19
 
20
   $url = str_replace(array('+', '/'), array('-', '_'), base64_encode($atts['url']));
21
 
22
 /* Return QR Code link */
23
 return '<div style="width: ' . $atts['size'] . 'px; ' . $atts['style'] . '"><img src="http://api.beliefmedia.com/qr/' . $atts['size'] . '-' . $atts['ec'] . '-' . $atts['border'] . '/' . $atts['bg'] . '-' . $atts['fg'] . '/' . $url . '.png?apikey=' . $atts['apikey'] . '"></div>';
24
}
25
add_shortcode('qr', 'beliefmedia_qrcode');

Usage is as follows: [qr url="http://www.beliefmedia.com/"]. The shortcode will return the following image:

If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.

Shortcode Attributes

The following may be used to alter the appearance of the QR Code. The attribute descriptions also apply to the PHP function arguments.

url

The URL is either a URL or text. A mobile phone will recognize a particular schema and launch an appropriate application (for example, phone numbers, SMS, MMS etc).

apikey

Clients should use their API key to ensure access isn't throttled.

size

The size of the QR code in pixels. We'll return a ode up to 3000 pixels. Clients can request a code up to billboard size.

ec

Error correction. Error correction to enable recovery of missing, misread, or obscured data (L, M, Q or H).

bg

Background color (without leading #).

fg

Foreground (code) color (without leading #).

border

The border size.

style

CSS applied to the returned image. We center the image with 20px of padding by default.

Considerations

  • Track the number of times a code is scanned by creating an image that returns a short URL.
  • Clients should log into the platform for additional features.

Download


Title: Include QR Codes on Your Website (WP Shortcode)
Description: Include QR Codes on Your Website. Utilises the BeliefMedia QR API.
  Download • Version 0.2, 605.0B, zip, Category: WordPress Shortcodes
PHP Code & Snippets, (662.0B)    

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

RELATED READING

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment