BernhardWebstudio / wp-conditional-analytics

WordPress Plugin providing a "accept" banner before embedding Google Analytics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wp-conditional-analytics

WordPress Plugin providing a "accept" banner before embedding Google Analytics (and other scripts that can be registered)

API

PHP

You can use, for example,

if (function_exists('wpca_enqueue_script')){
  wpca_enqueue_script($id, $url);
} else {
  wp_enqueue_script($id, $url);
}

to enqueue a script that should be loaded in case the cookies are accepted. Do this wherever (i.e., in a init hook) you would do the wp_enqueue_script.

JavaScript

This plugin exposes the following global functions:

About

WordPress Plugin providing a "accept" banner before embedding Google Analytics

License:MIT License


Languages

Language:PHP 69.4%Language:JavaScript 18.0%Language:CSS 12.6%