I want to give website visitors a chance to opt out of Google Analytics. However, the website I am working on is in PHP, so Google's Analytics seems to happen all on the server side. Visiting the webpage "inCognito, inPrivate or with private browsing" does not stop Google from accessing the general location, etc.
Is there a simple way while still keeping the page PHP rather than HTML to give the user a chance to opt-out?