https://github.com/arg0wak/google-opt-out
Google Opt-out refers to a set of tools and settings that allow users to opt-out of certain data collection or tracking activities when using Google services.
https://github.com/arg0wak/google-opt-out
analytics cookie cookie-consent google opt-out tracking
Last synced: about 1 year ago
JSON representation
Google Opt-out refers to a set of tools and settings that allow users to opt-out of certain data collection or tracking activities when using Google services.
- Host: GitHub
- URL: https://github.com/arg0wak/google-opt-out
- Owner: arg0WAK
- License: mit
- Created: 2024-05-23T13:20:20.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T16:11:51.000Z (about 2 years ago)
- Last Synced: 2025-06-18T00:42:55.284Z (about 1 year ago)
- Topics: analytics, cookie, cookie-consent, google, opt-out, tracking
- Language: HTML
- Homepage: https://arg0wak.github.io/google-opt-out/
- Size: 82 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Google Opt-Out (Cookie Consent)

Google Opt-out refers to a set of tools and settings that allow users to opt-out of certain data collection or tracking activities when using Google services. This is offered to users to enhance their privacy and help them avoid certain types of advertising or data collection. This repo gives the end user the option to refuse Analytics cookies. It supports both UA and GA4 properties.
## ⛓️ Dependencies
The dependencies are given below. If you are using a SASS Compiler, you do not need to install the `sass` package.
```bash
js-cookie
bootstrap
sass
```
## 🚨 Warnings
### Add PUBLIC_KEY
Add your `PUBLIC KEY` to the field given in the example below.
If you have the Universal Analytics property, update the `G-` entry to `UA-`.
`const PUBLIC_KEY = 'G-XXXXXXXXXX'`
### Defining Necessary and Optional Cookies
Before starting the installation, determine what cookies are required in your project. Define the ones you want to remove optionally among these cookies in the `optionalCookies` variable.
## 🚀 Installation
First of all clone the repo to your device using the link below.
```bash
$ git clone git@github.com:arg0WAK/google-opt-out.git
$ cd google-opt-out
```
Install all dependencies.
```bash
$ npm install
$ clear
```
Define your public key given by Google Analytics in the `PUBLIC_KEY` variable between the `` tags.
```bash
# Google tag (gtag.js) #
const PUBLIC_KEY = 'G-XXXXXXXXXX'
# Code is continuing.
```
Import `js.cookie.js` and `cookie.js` file just before the `