Skip to content

Commit

Permalink
V1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sajdoko committed Apr 5, 2024
1 parent 39fc02d commit 9636c36
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion includes/class-lwgdpr-cookie-consent-activator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function activate() {
}

// Exclude from cache 'lwgdpr_*' cookies
$WpFastestCacheExclude = get_option('WpFastestCacheExclude', []);
$WpFastestCacheExclude = get_option('WpFastestCacheExclude');
$WpFastestCacheExclude = json_decode($WpFastestCacheExclude, true);
$WpFastestCacheExclude[] = ["prefix" => "contain", "content" => "lwgdpr_", "type" => "cookie"];
update_option('WpFastestCacheExclude', json_encode($WpFastestCacheExclude));
Expand Down
4 changes: 2 additions & 2 deletions lwgdpr-cookie-consent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: LWGDPR Cookie Consent
* Plugin URI: https://github.com/sajdoko/lwgdpr-cookie-consent
* Description: Soluzione conforme al GDPR per informare gli utenti che il sito Web utilizza i cookie, con la possibilità di bloccare gli script prima del consenso.
* Version: 1.3.0
* Version: 1.3.1
* Author: Sajmir Doko
* Author URI: https://www.localweb.it/
* License: GPLv3
Expand Down Expand Up @@ -39,7 +39,7 @@
/**
* Currently plugin version.
*/
define( 'LW_GDPR_COOKIE_CONSENT_VERSION', '1.3.0' );
define( 'LW_GDPR_COOKIE_CONSENT_VERSION', '1.3.1' );
define( 'LW_GDPR_COOKIE_CONSENT_PLUGIN_DEVELOPMENT_MODE', false );
define( 'LW_GDPR_COOKIE_CONSENT_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
define( 'LW_GDPR_COOKIE_CONSENT_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
Expand Down
29 changes: 24 additions & 5 deletions public/js/lwgdpr-consent-public.js
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,6 @@ GDPR_CCPA_COOKIE_EXPIRE = (typeof GDPR_CCPA_COOKIE_EXPIRE !== 'undefined' ? GDPR

$(document).ready(
function () {

if (typeof lwgdpr_cookiebar_settings != 'undefined') {
GDPR.set({
settings: lwgdpr_cookiebar_settings
Expand All @@ -1177,12 +1176,9 @@ GDPR_CCPA_COOKIE_EXPIRE = (typeof GDPR_CCPA_COOKIE_EXPIRE !== 'undefined' ? GDPR

GDPR.setGoogleConsent();

}
);
},

$(document).ready(
function () {

$(".lwgdpr-column").click(
function () {
$(".lwgdpr-column", this);
Expand All @@ -1199,4 +1195,27 @@ GDPR_CCPA_COOKIE_EXPIRE = (typeof GDPR_CCPA_COOKIE_EXPIRE !== 'undefined' ? GDPR
}
);

$(window).on("load", function () {
$('a[href^="mailto"]').click(function () {
let gaCategory = this.getAttribute("data-vars-ga-category") || "email";
let gaAction = this.getAttribute("data-vars-ga-action") || "send";
let gaLabel = this.getAttribute("data-vars-ga-label") || this.href;
GDPR.gtag("event", gaAction, {"event_category": gaCategory,"event_label": gaLabel});
});

$('a[href^="tel"]').click(function () {
let gaCategory = this.getAttribute("data-vars-ga-category") || "telephone";
let gaAction = this.getAttribute("data-vars-ga-action") || "call";
let gaLabel = this.getAttribute("data-vars-ga-label") || this.href;
GDPR.gtag("event", gaAction, {"event_category": gaCategory,"event_label": gaLabel});
});

$(".wpcf7").on('wpcf7mailsent', function (event) {
let gaCategory = "form";
let gaAction = "submit";
let gaLabel = event.currentTarget.baseURI;
GDPR.gtag("event", gaAction, {"event_category": gaCategory,"event_label": gaLabel});
});
});

})(jQuery);
Loading

0 comments on commit 9636c36

Please sign in to comment.