An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          








Google Opt-Out (Cookie Consent)


![Google Opt-Out (Cookie Consent) Cover](https://arg0wak.github.io/gist/images/google-opt-out/2Q1NL3AAKQQUP8Z.png)

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 `