Determine unique phone attribute that scanned a QR code - php

All,
I'm allowing a user to scan a QR code and when they do I'd like to identify them by an attribute on their phone. Is there something that I can use or get from the mobile device (since they can use an iPad and not just a phone) to distinctly identify the user that scanned the QR and doesn't change like an IP address?
I'll know all my users who will be scanning the QR code so I'm trying to get a static and unique piece of information so I can identify them do they don't have to select their userid.
Please let me know if anyone has had any experience doing something like this.
Thanks!

If the QR content is a URL you can simply set a Google Analytics tag on that URL.
Although that won't give you information about the people who scan your code but the ones who scan your code AND follow the URL, that is usually an acceptable trade-of.

Related

What are the parts of google adwords url?

I need to automatically generate url to the existing advertisement in google adwords. I've got a link like this:
https://adwords.google.com/cm/CampaignMgmt?authuser=1&__u=%param_one%&__c=%param_two%#c.%param_three%.create&app=cm
I do not know what are those params one, two, and three. I do not know where can I get them and what is their role in an address. But I'd like to! In fact I just need to generate a URL to click on it and appear on an ad page. How can that be done? May be their lib provides a method to generate url like this?
Unfortunately that's not possible, at least not in a reliable way (see also this rather old post from the Adwords API forum).
The structure itself is not hard to parse:
Inside the query string, __u is your user account's ID while __c refers to the ID of the specific Adwords account. These don't appear to be in standard Adwords XXX-XXX-XXXX format, though, so you would have to either create a mapping of all your accounts or come up with the proper translation function.
The fragment refers to a specific Adwords entity, for instance; c.123 is the campaign with ID 123 while a.ABC_XYZ refers to the adgroup with ID ABC inside the campaign with ID XYZ.
But even if you manage to get the __u and __c parameters right, more often than not you will be redirected to your Adwords account's top level view.
Interestingly enough, Google Analytics introduced little buttons in the "Adwords" reporting tab a few months ago which are supposed to take you right to the correct campaign if you have access to the linked account, but even those only work half of the time, especially if your Adwords account is an MCC.

It is possible to change the Twitter username or screenname via PHP?

I'm creating a PHP app that basically changes and randomizes everything in a twitter user's profile.
I have managed to change the name, location, description and background colour; but I'm not able to change the screen name. Does anyone know if this is possible? I'm using the twitterOAuth library.
In short: No,
This would leave it open to all sorts of attacks.

Generate QR code to special page

I have qr code that generate code to my website www.myweb.com. But I want to customize : If visitor website generate code from QR code use smartphone it will redirect to www.myweb.com/qr.php. This the algorithm scheme:
If visitor website -> QR code
redirect to www.myweb.com/qr.php
Else
redirect to www.myweb.com
Any trick for that on PHP language, without change my QR code because I have already print on all collateral, like sticker, card name, etc ? I have search but not find yet.
If the link from the QR code is simply www.myweb.com, I'm afraid you are out of luck. There is absolutely no difference between reading a QR code and accessing the link and manually typing in the address.
The only possibility is you may be able to catch certain visitors if they are using an app to read the QR code, subsequently view the target page in-app, and said app has something identifiable about it's User Agent string. I have not experimented with this, but I would suspect this is actually not the case.

Restrict site access to QR scans only

I saw a few questions out there already about ensuring site access comes from QR code scans, but they seemed to be focused on analytics purposes (tracking where traffic was coming from), whereas my interest is in security/privacy.
I want to set up a site that can only be accessed when a provided QR code is scanned. In other words, I don't want the URL that the QR code possesses to be able to just be manually typed/pasted in for site access via other means.
I've been googling this issue for a bit with no luck whatsoever. I'm trying to think of a way with referring URLs or other means to ensure that a person arrived at the site by actually scanning the provided QR code.
EDIT: The solution would need to be scanner-independent as well (i.e. I cannot force users to download and use a specific QR scanner app) and cross-platform (Android + iOS + WinMo + BlackBerry, etc.).
Now I submit the issue to you wonderful folks.
We got something the same at our company. We provide a link like:
zxing://scan/?ret=http%3A%2F%2Ffoo.com%2Fproducts%2F%7BCODE%7D%2Fdescription&SCAN_FORMATS=UPC_A,EAN_13
Where {CODE} is the code which is returned in the QRCode. So what you can do is create an url like above (see more info for a link). And then put a encrypted data in the QRCode, so only if this url is clicked by the user and the data of the QRcode is correct. People can continue to go on your website. This way if the qrcode is leaked, they won't know the site. And if they know the site, the code is encrypted.
If people scan the barcode by clicking on your website. The zxing will open a new browser with the URL and the {CODE} filled with the scanned code.
But, people do need the barcode scanner from android or iphone.
More info:
zxing download / homepage
zXing scanning from w
You can't ensure that the URL came from scanning the QR code, that isn't possible. QR codes are just a method of encoding text, once the user knows the text they can do whatever they want with it.
You can, however, restrict the usefulness of the QR code so even if it is leaked it isn't useful. If possible, I would start by generating the QR codes on-demand with a random seed and have them expire shortly thereafter. This would make it so even if the QR code were leaked, it wouldn't be useful for very long.
About the best you can do is set a query string in your QR code. Something like:
http://www.example.com/myapp
Could be changed to something like:
http://www.example.com/myapp/?qrcode=1
This can then be handled in PHP with:
if(!isset($_GET['qrcode'])) die();
The problem with this, of course, though, is that anyone with the URL could simply navigate directly to that URL in their normal web browser.
This isn't something you can prevent, however.
You can also check whether $_SERVER['HTTP_USER_AGENT'] claims to be a mobile phone. Here's another question on the topic.
You could add parameters, but ultimately QR codes are just a method of encoding text, so whatever you encode can be typed into a browser if someone knows what's encoded.
If you are making post call to any web URL from QR code, then whatever body you are sending with it, will not be visible unless user went through QR scan mode.So by just entering Web URL user will not able to access web URL contents.

QR Code Location Check

I have been told to work out a means of calculating whether a user has accessed a website from scanning a QR code or by accessing through normal methods. The company are using Google Analytics. Ideally the system would calculate what country the user is in when the QR code was scanned, although I think Google analytics does most of this for me.
My initial idea was to have a blank redirect page in the middle of the QR code and the full site, and put some separate analytics code in to that. Alternatively I could perhaps throw in a PHP referrer script that alters the analytics code based on the response, but this would still require a landing redirect page.
I'm a bit of a newbie, and this is quite a big client, so I thought I'd ask on here before starting anything that might not be the best method!
That’s one good option. Another would be to use a query string parameter in the URL, like this:
http://example.com/page/?from=qrcode
If you have control over the QR codes, you can add a GET variable to the URL, and then in your index page, you merely test for the QR-code GET variable and {do magic} if it is set or has a certain value.
I would use an intermediate page, as it gives you one point of entry for all QR encoded URLs.
From the QR code:
http://yoursite.com/qr.php?url=http%3A%2F%2Fyoursite.com%2Ffoo.php
Anywhere else:
http://yoursite.com/foo.php
Then on qr.php, you would simply use a header() redirect to $_GET['url'] after you're done with whatever statistics you're going to record or analyze.
Well if you can change the QR code:
-change the info to something like www.client-site.com\landing.php?referer=qr
You can check then in your landing.php
If you can't (then it is messy):
-when accessing through QR code then the HTTP_REFERER is empty and the client is using a phone with a certain browser, you can use this info to determine if he is using a phone and accessed the page directly (90% of cases people use Google before goint directly to a site- in this case you have a HTTP_REFERER)
Hope this helps...
I would build your URL for the QR code using Google's Analytics URL builder.
That way, you don't have to create custom filters are anything. Also, if you ever create new QR codes in the future on any other marketing material, you can track which marketing concept worked easily, rather than just saying that it was just a QR code that brought them to the site. Good luck.

Categories