diff --git a/att-consent.php b/att-consent.php index 7484df1..639d9d0 100644 --- a/att-consent.php +++ b/att-consent.php @@ -3,7 +3,7 @@ * Plugin Name: ATT Consent * Plugin URI: https://github.com/att-consent/att-consent * Description: Google Consent Mode v2 cookie consent with session attribution preservation, custom script management, and full gtag.js/GTM support. - * Version: 1.3.1 + * Version: 1.3.2 * Requires at least: 6.0 * Requires PHP: 7.4 * Author: ATT Consent @@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } -define( 'ATT_CC_VERSION', '1.3.1' ); +define( 'ATT_CC_VERSION', '1.3.2' ); define( 'ATT_CC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'ATT_CC_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'ATT_CC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); diff --git a/public/js/consent-manager.js b/public/js/consent-manager.js index 585e572..797e647 100644 --- a/public/js/consent-manager.js +++ b/public/js/consent-manager.js @@ -121,11 +121,13 @@ var AttConsent = (function() { /** * Store consent choices in a first-party cookie. + * If analytics is denied, use a short 3-day expiry so the banner re-appears + * automatically rather than locking a denial in for a year. * * @param {Object} categories Consent categories. */ function setConsentCookie(categories) { - var days = config.consent_expiry || 365; + var days = categories.analytics ? (config.consent_expiry || 365) : 3; var expires = new Date(Date.now() + days * 864e5).toUTCString(); var value = encodeURIComponent(JSON.stringify(categories)); var cookie = 'att_cc_consent=' + value +