CCPA “Do Not Sell” Link
CookieRay can show a small “Do Not Sell or Share My Personal Information” link to visitors it detects as being in the United States. One click opts the visitor out of all non-essential categories.
Who sees it
The link is shown only when CookieRay detects the visitor’s country as US. Country detection uses a header from your host or CDN (for example Cloudflare’s CF-IPCountry, CloudFront’s viewer country header, or similar), or the PHP GeoIP extension. If your server provides none of these, no country is detected and the link is not shown.
It appears as a small text link at the bottom center of the page. It shows up after the visitor has made a choice on the banner, and on later visits while their choice is saved. It is not shown next to the banner on a first visit.
What a click does
When a visitor clicks the link, CookieRay:
- Records a Rejected All consent with the Analytical, Functional and Marketing categories all off.
- Saves that choice in the visitor’s browser and adds it to your consent logs.
- Deletes known tracking cookies for the declined categories.
- Updates Google Consent Mode v2 to denied, if you have it switched on.
- Briefly shows ”✓ Opt-out recorded”, then removes the link for that page view. It returns on the next page load, because the visitor now has a saved choice.
Necessary cookies are not affected.
Things to know
- The country is read when the page is built. If a caching plugin serves the same cached page to everyone, the link can appear or stay hidden for the wrong visitors. Ask your host to vary the cache by country, or test with caching off.
- The link text is fixed in the admin. Developers can change it with the
cookieray_frontend_configfilter (setbanner.ccpaText). - It is available on sites where the banner is enabled and loaded for the visitor. If a visitor’s country is hidden from the banner by Geo Targeting (Pro), CookieRay does not load for them.
- Opting out does not reload the page, so a script that has already run in that page view keeps running until the next page load. In Strict mode scripts for declined categories do not load on later pages.
- Style it with CSS using the
.cookieray-ccpa-linkclass. With Pro, see the Custom CSS Reference.
Testing it
- Make sure your host or CDN sends a US country header. The easiest check is to use a US-based VPN or your host’s geolocation tools.
- Load a page with the banner enabled and choose an option on the banner. Look for the link at the bottom of the page.
- Click it and confirm the link changes to ”✓ Opt-out recorded”.
- Open Consent Logs and check for a new Rejected All record.
This link is a convenience for the opt-out part of CCPA/CPRA workflows. It does not by itself make a site compliant. Your privacy policy, how your third-party tools handle data, and the laws that apply to you all matter. CookieRay does not provide legal advice.