How do you track usage of QRcodes? - qr-code

I don't know if this even is possible, but here goes, how do you track usage of QRcodes? (track scans may be more accurate)
I'm not primarily looking for code snippets (they are of course welcome), but a method for doing this.
Thanks for all your answers :)
Lars

Assuming that the QR codes in question are URLs, put an extra query parameter at the end of the URL containing some means of identifying the QR code. Then, have the target page check for the presence of this query parameter. If the value in the parameter is in your database, increment its counter. You'll obviously have to generate and distribute multiple QR codes with differing values for your query parameter.

From my experience the easiest way to track usage of your QR codes is to encode all URLs you are planning to put into QR codes via URL shortener like bit.ly.
By doing so you will achive two results:
"free" clicks/scans analytics from bit.ly
you have really short URLs which allow you to use smaller QR codes (easier to scan with low-res camera-phones) or better error correction

Related

QR Code - is uniqueness guaranteed for unique inputs

I want to generate QR codes to pass a unique alpha-numeric code to a site. The QR will be generated from a string like:
https://example.com/ABCD1234
The ABCD1234 is the unique code and there will be ~100 million of them. Can I be sure no two QR codes will be the same, and be read to 100% accuracy?
Anything to watch out for standards wise?
100% is too pure of a number to get specific advice. This reply is general, and not meant for any super mission critial needs.
The clarity of barcodes in general depends on the quality of the printed image, as well as the reader's ability to decode (optics and decoder). QR codes have some error correction attributes (https://en.wikipedia.org/wiki/QR_code). Commercial decoders, even for webcams, are used widely for consumer and retail applications.
Keep in mind, barcodes were designed for reading labels quickly, and often while moving. They are not well suited for things like security codes, where deep levels of checks are needed. It is possible for things to go wrong.
Given that, it really depends on what you mean by 100%. The barcode symbology cannot make many guarantees, but the content might begin to. If your line-of-business app is mildly mission critical, and your app can control what's printed on labels, and the http address is to 'your' line-of-business web site, you could append a check value within the content, in the QR code printed. For example, ~https://example.com/ABC1234?check=5551212, has a check value which the web site can optionally verify. However, the more content you have, the more dense the printed pattern will get (and possibly more difficult to read).

QR Code with multiple information type

I was wondering if there's a way to build a QR code with two kinds of data - one text data and two link URLs. Is it possible to do it?
A QR Code is a two-dimensional barcode capable of storing (according to Wikipedia) up to 2,953 bytes of binary data or 4,296 simple alphanumeric characters. The data can contain whatever you like.
The difficulty with storing multiple URLs in a QR-code is not that it is impossible, but that most scanner apps in smart phones and so on will only process a single URL. If you are writing the scanner app too then, yes, it it possible, otherwise it is possible but probably not advisable.
If you wish to store a single URL and some contact details you might look at storing a vCard in your QR code (here is a generator; I have no affiliation with this project).
It's indeed possible, but all scanner apps will not recognize all the data, and only one show one data. This QR code generator has a Multi URL feature that can redirect based on different parameters as time, location, device, ...
It is possible. we can enter text,URL,v card on a single QR code.
Well, actually, the QR code is "only" storing characters, so you could imagine having an app or any software that read the QR code content, which contains data and two URL, which split the string to open two tab.

REST resources with a triple as a parameter

When needing to create a URL that takes a finite set of parameters, where all of said parameters are semantically the same "level", what is the current consensus around the use of delimiters within URLs? Here's an example:
/myresource/thing1,thing2,thing3
/myresource/thing2,thing1
/myresource/thing1;thing2;thing3
/myresource/thing1;thing3
That is to say, the parameter here could be a single, a pair or a triple. They can be specified in any order because they are not a logical tree, and thing2 is not a subordinate resource of thing1, so doing something like this seems "wrong":
/myresources/thing1/thing2/thing3
This bothers me because it implies a tree-like relationship between the elements of the triple, and that is not the case (despite many HTTP frameworks seemingly pushing this, wrongly in my view). In addition, using a query string doesn't feel right as this is not a search operation, it is a known triple in a very finite space - there's nothing to query or search, so to speak.
I suppose the other option would be to make it a POST request and supply a body that details the parts of the triple being supplied. This doesn't give me warm fuzzies though, for some reason.
How have others handled this? Delimiters seem clean to me, and communicate the intended semantics of the resource, but i know there are folks would would take a different view, and I was looking to understand the experiences of others who've had similar use cases.
Since any value can be missing and values can appear in any order, How would you know which value is for which parameter (if that matters).
I would have used query string for GET, or in the payload for POST.
Use query parameters
/path/to/the/resource?key1=value1&key2=value2&key3=value3
or matrix parameters
/path/to/the/resource;key1=value1;key2=value2;key3=value3
Without a proper example, I'm not sure exactly about your needs.
However, a little known fact is that any HTTP parameter can have multiple values. It is the way to go when you have a set of objects (see GoogleMaps static API for an example).
/path/to/the/resource?things=thing1&things=thing2&things=thing3
Then you can use the same API for single, pairs, triples (and more).

Different representations of one resource

When i have a resource, let's say customers/3 which returns the customer object and i want to return this object with different fields, or some other changes (for example let's say i need to have include in customer object also his latest purchase (for the sake of speed i dont want to do 2 different queries)).
As i see it my options are:
customers/3/with-latest-purchase
customers/3?display=with-latest-purchase
In the first option there is distinct URI for the new representation, but is this REALLY needed? Also how do i tell the client that this URI exist?
In the second option there is GET parameter telling the server what kind of representation to return. The URI parameters can be explained through OPTIONS method and it is easier to tell client where to look for the data as all the representations are all in one place.
So my question is which of these is better (more RESTful) and/or is there some better way to do this that i do not know about?
I think what is best is to define atomic, indivisible service objects, e.g. customer and customer-latest-purchase, nice, clean, simple. Then if the client wants a customer with his latest purchases, they invoke both service calls, instead of jamming it all in one with funky parameters.
Different representations of an object is OK in Java through interfaces but I think it is a bad idea for REST because it compromises its simplicity.
There is a misconception that making query parameters look like file paths is more RESTful. The query portion of the address is included when determining a distinct URI so the second option is fine.
Is there much of a performance hit in including the latest purchase data in all customer GET requests? If not, the simplest thing would be to do that so there would neither be weird URL params or double requests. If getting the latest order is a significant hardship (which it probably shouldn't be) there is nothing wrong with adding a flag in the query string to include it.

How to decode U.P.S. Information from UPS MaxiCode Barcode?

I recently purchased a 2D Barcode reader. When scanning a U.P.S. barcode, I get about half of the information I want, and about half of it looks to be encrypted in some way. I have heard there is a UPS DLL.
Example - Everything in bold seems to be encrypted, while the non-bold text contains valuable, legitimate data.
[)>01961163522424800031Z50978063UPSN12312307G:%"6*AH537&M9&QXP2E:)16(E&539R'64O
In other words, this text seems OK - and I can parse the information
[)>01961163522424800031Z50978063UPSN123123 ...
While, this data seems to be encrypted
... 07G:%"6*AH537&M9&QXP2E:)16(E&539R'64O
Any Ideas???
Everything I read on the internet says I should be able to read this thing. I'm just not finding any information on specifics. The "encrypted" info contains street address, package number (like 1/2), weight, and several other items Im dying to get my hands on. I suppose I will contact UPS directly.
The data after the SCAC is compressed and requires a DLL or some other component from UPS in order to decode. Note that a MaxiCode holds only about 100 characters of data so compression is required in order to encode more shipping data.
It seems to be well-documented ... anything cryptic is likely to be info the shipper is including for their own (or their customer's) purposes.
I know that the block of characters you get when scanning those barcodes is divided up into blocks using non-printing characters, so trying to view the characters without knowing how they are divided by the encoder is tough. Look for info on the format in which they store their data, or find a decoder that will display those characters.
This is a page I have come across before, however, this page discusses ENCODING a barcode, using plain English and some component. The information used to ENCODE is the information I would like to retrieve when DECODING.
Like I said, when the information is RETRIEVED, half of the information comes out Garbled (encrpyted?) and there is no documentation about to decrypt that code...
According to the link you sent me, I should see something like this:
[)>01963360910628400021Z14647438UPSN410E1W1951/1Y135ReoTAMPAFL
However, I get something like this:
[)>01961163522424800031Z50978063UPSN12312307G:%"6*AH537&M9&QXP2E:)16(E&539R'64O
This leads me to believe the page you sent me is either out-of-date, or that it is simply a reference for how to use their controls to encode, not decode.
Why would you suppose that UPS wants you to decode that part? Moreover, I believe that the piece of code is not encoded - it may be ID of something in their DB.
I expect the unreadable part is not UPS data, but private data intentially obfuscated by agreement between the shipper and receiver.
Check this site out it provides a free decode app.
MaxiCode Barcode FAQ & Tutorial by IDAutomation®
Maxicode is an international 2D (two-dimensional) barcode that is currently used by UPS on shipping labels for world-wide addressing and package sortation. ...
http://www.idautomation.com/maxicodefaq.html
http://www.google.com/patents/US7039496 has quite a bit of information about the encoded data in images 3-12. It looks like the first gives the uncompressed format, while the second is a compression dictionary. The description makes reference to a lot of ANSI standards that are beyond my comprehension, but it does appear that what you're seeing is a format '07' string, so perhaps there's enough information here to do a complete decode?
Bearing in mind, of course, that this is part of a patent and that implementing it without paying royalties could get you in trouble. IANAL

Resources