Website functionality depending if it was accessed via QR code or not

im new on stackoverflow, so don’t be harsh xD

Im still learning and there is so much that i dont know yet

Im currently developing a website and got stuck with a question:
how to make a website perform differently if it was accessed via a QR code?

For example if a person gets to a website through QR code they can see a button, but if a person gets to a website through copying url or searching through the web, then there is no button.

I have looked through the web, W3 and stackoverflow, but couldn’t find anything that could be similar, hence thats the reason why im here =)

The only thing that i found was (see below), however im not sure it has any use for my idea

var referrer = document.referrer

I dont use php and have no idea of how to use it, hence no php please =)