Un plugin de GDPR de JavaScript para Google Analytics-sin Trackless

Tiempo de ejecución: 30 minutos. Empezar

Autor: ascorbic
Views Total: 1,171
Sitio oficial: Ir a la web
Actualizado: May 29, 2018
Licencia: MIT

Vista prévia

Un plugin de GDPR de JavaScript para Google Analytics-sin Trackless

Descripción

Una gran herramienta para hacer que su sitio Web cumpla con el Reglamento General de protección de datos (GRPD).

Trackless es un pequeño pero útil plugin de JavaScript para hacer su Google Analytics < a href = "https://en.wikipedia.org/wiki/General_Data_Protection_Regulation" target = "_ blank" rel = "noopener" > GDPR compatible.

El plugin le permite crear el botón sin Trackless y la casilla de verificación que permite a sus visitantes a opt-in y opt-out de Google Analytics en su sitio Web.

More resources about GDPR:

  • < a href = "https://www.adpushup.com/blog/a-gdpr-checklist-for-those-who-are-tired-of-gdpr-checklists/" target = "_ blank" rel = "noopener" > una lista de comprobación GDPR para aquellos que están cansados de las listas de verificación GDPR
  • < a href = "https://codecanyon.net/item/ultimate-gdpr-compliance-jquery-toolkit/22042885? ref = jqueryscript" target = "_ blank" rel = "noopener" > Ultimate RGPD Compliance Toolkit de jQuery
  • < a href = "https://www.eugdpr.org/" target = "_ blank" rel = "noopener" > portal de información del RGPD de la UE
  • compatible con el RGPD cookie plugin popup – jQuery ihavecookies. js
  • < a href = "https://wpmissing.com/plugins/best-gdpr-plugins/" target = "_ blank" rel = "noopener" > mejores plugins de GDPR para hacer que tu WordPress GDPR cumpla
  • complemento de cumplimiento de cookies de GDPR

Funcionamiento

Instale el Trackless con NPM o yarn.

# Yarn
$ yarn add trackless

# NPM
$ npm install trackless --save

Importe el Trackless.

// ES 6
import Trackless from 'trackless';

O incluya el archivo compilado en la sección Head de la página web, antes de su código de Google Analytics.

<script async src="https://unpkg.com/[email protected]"></script>

Cree una nueva instancia y especifique el ID de seguimiento.

const myTrackless = new Trackless({



 trackingID: "TRACKING ID HERE"
 });

Enlazar el Trackless a cualquier elemento con la clase de ' trackless '.

myTrackless.bindElements();

Cree elementos para participar y optar por no participar en Google Analytics.

<input class='trackless' type='button'>
<a href='#' class='trackless'></a>
<input class='trackless' type='checkbox'>
<label>Tracking enabled</label>

Opciones de configuración disponibles.

const myTrackless = new Trackless({




 // Prompt text



optOutText: "Don't track me",



optInText: "Enable tracking",




// Initial opt-out value



 initialOptOut: false,




// Override opt-out value.



 // If true, sets the stored preference to the initialOptOut value.



 // Use this if, for example, you have a logged-in user and want to sync the preference between devices.



overrideOptOut: false,




// Invert the behaviour of checkboxes.



 // By default, a checkbox is checked if the user is not opted-out.



 // Set this to true so that it is checked if the user is opted-out.



invertCheckbox: false,




// Called when opt-out value is changed.



 // Passed the new opt-out value.



callback: function(value){}




});

Te puede interesar: