Changeset 3110812
- Timestamp:
- 07/02/2024 04:19:13 AM (6 weeks ago)
- Location:
- woocommerce-google-analytics-integration
- Files:
-
- 12 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-google-analytics-integration/tags/2.1.4/assets/js/build/main.asset.php
r3106905 r3110812 1 <?php return array('dependencies' => array('wp-hooks', 'wp-i18n'), 'version' => ' b091c96660339cb2bb2e');1 <?php return array('dependencies' => array('wp-hooks', 'wp-i18n'), 'version' => ''); -
woocommerce-google-analytics-integration/tags/2.1.4/assets/js/build/main.js
r3106905 r3110812 1 (()=>{"use strict";var t={d:(e,o)=>{for(var c in o)t.o(o,c)&&!t.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:o[c]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{add_to_cart:()=>w,begin_checkout:()=>f,purchase:()=>h,remove_from_cart:()=>g,search:()=>v,select_content:()=>y,view_item:()=>b,view_item_list:()=>m});const o=window.wp.i18n,c=window.wp.hooks,n=(t,e)=>{var o;const c={};t.variation&&(c.item_variant=t.variation);const n={item_id:d(t),item_name:t.name,...u(t),quantity:null!==(o=t.quantity)&&void 0!==o?o:e,price:i(t.totals?.line_total||t.prices.price,t.prices.currency_minor_unit),...c};return t?.price_after_coupon_discount<t.prices.price&&(n.discount=i(t.prices.price-t.price_after_coupon_discount,t.prices.currency_minor_unit),n.price=i(t.price_after_coupon_discount,t.prices.currency_minor_unit)),n},r=(t,e)=>({item_id:d(t),item_name:t.name,item_list_name:e,...u(t),price:i(t.prices.price,t.prices.currency_minor_unit)}),i=(t,e=2)=>parseInt(t,10)/10**e,a=(t,e,o)=>{(0,c.removeAction)(t,e),(0,c.addAction)(t,e,o)},d=t=>{const e=t.extensions?.woocommerce_google_analytics_integration?.identifier;return void 0!==e?e:"product_sku"===window.ga4w?.settings?.identifier?t.sku?t.sku:"#"+t.id:t.id},s=t=>t.coupons[0]?.code?{coupon:t.coupons[0]?.code}:{},u=t=>"categories"in t&&t.categories.length?_(t.categories):{},_=t=>Object.fromEntries(t.slice(0,5).map(((t,e)=>[p(e),t.name]))),p=t=>"item_category"+(t>0?t+1:""),l=(t,e,o)=>{var c;return null!==(c=e?.find((({id:e})=>e===t)))&&void 0!==c?c:o?.items?.find((({id:e})=>e===t))},m=({products:t,listName:e=(0,o.__)("Product List","woocommerce-google-analytics-integration")})=>0!==t.length&&{item_list_id:"engagement",item_list_name:(0,o.__)("Viewing products","woocommerce-google-analytics-integration"),items:t.map(((t,o)=>({...r(t,e),index:o+1})))},w=({product:t,quantity:e=1})=>({items:t?[n(t,e)]:[]}),g=({product:t,quantity:e=1})=>({items:t?[n(t,e)]:[]}),f=({storeCart:t})=>({currency:t.totals.currency_code,value:i(t.totals.total_price,t.totals.currency_minor_unit),...s(t),items:t.items.map(n)}),y=({product:t})=>!!t&&{content_type:"product",content_id:d(t)},v=({searchTerm:t})=>({search_term:t}),b=({product:t,listName:e=(0,o.__)("Product List","woocommerce-google-analytics-integration")})=>!!t&&{items:[r(t,e)]},h=({order:t})=>void 0!==t&&{transaction_id:t.id,affiliation:t.affiliation,currency:t.totals.currency_code,value:i(t.totals.total_price,t.totals.currency_minor_unit),tax:i(t.totals.tax_total,t.totals.currency_minor_unit),shipping:i(t.totals.shipping_total,t.totals.currency_minor_unit),items:t.items.map(n)},k="woocommerce-google-analytics",A="experimental__woocommerce_blocks";(0,c.removeAction)(`${A}-checkout-submit`,k),(0,c.removeAction)(`${A}-checkout-set-email-address`,k),(0,c.removeAction)(`${A}-checkout-set-phone-number`,k),(0,c.removeAction)(`${A}-checkout-set-billing-address`,k),(0,c.removeAction)(`${A}-cart-set-item-quantity`,k),(0,c.removeAction)(`${A}-product-search`,k),(0,c.removeAction)(`${A}-store-notice-create`,k);const E={statistics:["analytics_storage"],marketing:["ad_storage","ad_user_data","ad_personalization"]};function $(){(({tracker_function_name:t})=>{if("function"==typeof wp_has_consent){void 0===window.wp_consent_type&&(window.wp_consent_type="optin");const e={};for(const[t,o]of Object.entries(E))if(""!==consent_api_get_cookie(window.consent_api.cookie_prefix+"_"+t)){const c=wp_has_consent(t)?"granted":"denied";o.forEach((t=>{e[t]=c}))}Object.keys(e).length>0&&window[t]("consent","update",e)}})(window.ga4w.settings),(({tracker_function_name:t})=>{document.addEventListener("wp_listen_for_consent_change",(e=>{const o={},c=E[Object.keys(e.detail)[0]],n="allow"===Object.values(e.detail)[0]?"granted":"denied";void 0!==c&&(c.forEach((t=>{o[t]=n})),Object.keys(o).length>0&&window[t]("consent","update",o))}))})(window.ga4w.settings);const t=function({events:t,tracker_function_name:o}){return function(c){const n=e[c];if("function"!=typeof n)throw new Error(`Event ${c} is not supported.`);return function(e){const r=n(e);t.includes(c)&&r&&window[o]("event",c,r)}}}(window.ga4w.settings);!function(t,{events:e,cart:o,products:c,product:n,added_to_cart:r,order:i}){Object.values(null!=e?e:{}).forEach((e=>{"add_to_cart"===e?t(e)({product:r}):t(e)({storeCart:o,products:c,product:n,order:i})}));const a=document.body.onadded_to_cart;document.body.onadded_to_cart=function(e,r,i,d){"function"==typeof a&&a.apply(this,arguments);const s=parseInt(d[0].dataset.product_id||d[0].value),u=n?.id===s?n:l(parseInt(s),c,o);u&&t("add_to_cart")({product:u})};const d=()=>{document.querySelectorAll(".woocommerce-cart-form .woocommerce-cart-form__cart-item .remove[data-product_id]").forEach((t=>t.addEventListener("click",s)))};function s(e){t("remove_from_cart")({product:l(parseInt(e.target.dataset.product_id),c,o)})}d();const u=document.body.onupdated_wc_div;document.body.onupdated_wc_div=function(){"function"==typeof u&&u.apply(this,arguments),d()};const _=document.body.onremoved_from_cart;document.body.onremoved_from_cart=function(){"function"==typeof _&&_.apply(this,arguments),s({target:arguments[3][0]})},document.querySelectorAll(".products .product:not(.wp-block-post)")?.forEach((e=>{const n=e.querySelector("a[data-product_id]")?.getAttribute("data-product_id");n&&e.addEventListener("click",(e=>{const r=e.target.closest(".woocommerce-loop-product__link"),i=e.target.classList.contains("button")&&e.target.hasAttribute("data-product_id"),a=e.target.classList.contains("add_to_cart_button")&&!e.target.classList.contains("product_type_variable");(r||i&&!a)&&t("select_content")({product:l(parseInt(n),c,o)})}))})),document.querySelectorAll(".products-block-post-template .product, .wc-block-product-template .product")?.forEach((e=>{const n=e.querySelector("[data-product_id]")?.getAttribute("data-product_id");n&&e.addEventListener("click",(e=>{const r=e.target,i=r.closest(".wc-block-components-product-image a"),a=r.closest(".wp-block-post-title a"),d=r.closest(".wc-block-components-product-button [data-product_id]");d&&d.classList.contains("add_to_cart_button")&&!d.classList.contains("product_type_variable")?t("add_to_cart")({product:l(parseInt(n),c,o)}):(i||d||a)&&t("select_content")({product:l(parseInt(n),c,o)})}))}))}(t,window.ga4w.data),(t=>{a(`${A}-product-render`,k,t("view_item")),a(`${A}-cart-remove-item`,k,t("remove_from_cart")),a(`${A}-checkout-render-checkout-form`,k,t("begin_checkout")),a(`${A}-cart-add-item`,k,(({product:e})=>{t("add_to_cart")({product:e})})),a(`${A}-product-list-render`,k,t("view_item_list")),a(`${A}-product-view-link`,k,t("select_content"))})(t)}function L(){window.ga4w||console.warn("Google Analytics for WooCommerce: Configuration and tracking data not found after the page was fully loaded. Make sure the `woocommerce-google-analytics-integration-data` script gets eventually loaded.")}window.ga4w?$():(document.addEventListener("ga4w:ready",$),"complete"===document.readyState?L():window.addEventListener("load",L))})();1 (()=>{"use strict";var t={d:(e,o)=>{for(var ))})(); -
woocommerce-google-analytics-integration/tags/2.1.4/changelog.txt
r3106905 r3110812 1 1 *** Changelog *** 2 3 4 5 6 2 7 3 8 = 2.1.3 - 2024-06-25 = -
woocommerce-google-analytics-integration/tags/2.1.4/includes/class-wc-google-analytics.php
r3103953 r3110812 205 205 $this->method_description .= "<div class='notice notice-info'><p>" . __( 'Please allow Google Analytics 24 hours to start displaying results.', 'woocommerce-google-analytics-integration' ) . '</p></div>'; 206 206 207 // phpcs: disable WordPress.Security.NonceVerification.Recommended207 // phpcs:e WordPress.Security.NonceVerification.Recommended 208 208 if ( isset( $_REQUEST['woocommerce_google_analytics_ga_ecommerce_tracking_enabled'] ) && true === (bool) $_REQUEST['woocommerce_google_analytics_ga_ecommerce_tracking_enabled'] ) { 209 209 $this->method_description .= "<div class='notice notice-info'><p>" . __( 'Please note, for transaction tracking to work properly, you will need to use a payment gateway that redirects the customer back to a WooCommerce order received/thank you page.', 'woocommerce-google-analytics-integration' ) . '</div>'; -
woocommerce-google-analytics-integration/tags/2.1.4/readme.txt
r3106905 r3110812 4 4 Requires at least: 6.2 5 5 Tested up to: 6.5 6 Stable tag: 2.1. 36 Stable tag: 2.1. 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 49 49 == Changelog == 50 50 51 52 53 54 55 51 56 = 2.1.3 - 2024-06-25 = 52 57 * Add - WooCommerce Product Bundles integration. … … 56 61 * Tweak - Do not replace other extensions' `add_to_cart` listeners. 57 62 58 = 2.1.1 - 2024-06-12 =59 * Tweak - Confirm WC_Cart is available before formatting cart data.60 * Tweak - WC 9.0 compatibility.61 62 63 [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-google-analytics-integration/trunk/changelog.txt). -
woocommerce-google-analytics-integration/tags/2.1.4/woocommerce-google-analytics-integration.php
r3106905 r3110812 6 6 * Author: WooCommerce 7 7 * Author URI: https://woocommerce.com 8 * Version: 2.1. 38 * Version: 2.1. 9 9 * WC requires at least: 8.4 10 10 * WC tested up to: 9.0 … … 25 25 if ( ! class_exists( 'WC_Google_Analytics_Integration' ) ) { 26 26 27 define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_VERSION', '2.1. 3' ); // WRCS: DEFINED_VERSION.27 define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_VERSION', '2.1.' ); // WRCS: DEFINED_VERSION. 28 28 define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_MIN_WC_VER', '6.8' ); 29 29 -
woocommerce-google-analytics-integration/trunk/assets/js/build/main.asset.php
r3106905 r3110812 1 <?php return array('dependencies' => array('wp-hooks', 'wp-i18n'), 'version' => ' b091c96660339cb2bb2e');1 <?php return array('dependencies' => array('wp-hooks', 'wp-i18n'), 'version' => ''); -
woocommerce-google-analytics-integration/trunk/assets/js/build/main.js
r3106905 r3110812 1 (()=>{"use strict";var t={d:(e,o)=>{for(var c in o)t.o(o,c)&&!t.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:o[c]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{add_to_cart:()=>w,begin_checkout:()=>f,purchase:()=>h,remove_from_cart:()=>g,search:()=>v,select_content:()=>y,view_item:()=>b,view_item_list:()=>m});const o=window.wp.i18n,c=window.wp.hooks,n=(t,e)=>{var o;const c={};t.variation&&(c.item_variant=t.variation);const n={item_id:d(t),item_name:t.name,...u(t),quantity:null!==(o=t.quantity)&&void 0!==o?o:e,price:i(t.totals?.line_total||t.prices.price,t.prices.currency_minor_unit),...c};return t?.price_after_coupon_discount<t.prices.price&&(n.discount=i(t.prices.price-t.price_after_coupon_discount,t.prices.currency_minor_unit),n.price=i(t.price_after_coupon_discount,t.prices.currency_minor_unit)),n},r=(t,e)=>({item_id:d(t),item_name:t.name,item_list_name:e,...u(t),price:i(t.prices.price,t.prices.currency_minor_unit)}),i=(t,e=2)=>parseInt(t,10)/10**e,a=(t,e,o)=>{(0,c.removeAction)(t,e),(0,c.addAction)(t,e,o)},d=t=>{const e=t.extensions?.woocommerce_google_analytics_integration?.identifier;return void 0!==e?e:"product_sku"===window.ga4w?.settings?.identifier?t.sku?t.sku:"#"+t.id:t.id},s=t=>t.coupons[0]?.code?{coupon:t.coupons[0]?.code}:{},u=t=>"categories"in t&&t.categories.length?_(t.categories):{},_=t=>Object.fromEntries(t.slice(0,5).map(((t,e)=>[p(e),t.name]))),p=t=>"item_category"+(t>0?t+1:""),l=(t,e,o)=>{var c;return null!==(c=e?.find((({id:e})=>e===t)))&&void 0!==c?c:o?.items?.find((({id:e})=>e===t))},m=({products:t,listName:e=(0,o.__)("Product List","woocommerce-google-analytics-integration")})=>0!==t.length&&{item_list_id:"engagement",item_list_name:(0,o.__)("Viewing products","woocommerce-google-analytics-integration"),items:t.map(((t,o)=>({...r(t,e),index:o+1})))},w=({product:t,quantity:e=1})=>({items:t?[n(t,e)]:[]}),g=({product:t,quantity:e=1})=>({items:t?[n(t,e)]:[]}),f=({storeCart:t})=>({currency:t.totals.currency_code,value:i(t.totals.total_price,t.totals.currency_minor_unit),...s(t),items:t.items.map(n)}),y=({product:t})=>!!t&&{content_type:"product",content_id:d(t)},v=({searchTerm:t})=>({search_term:t}),b=({product:t,listName:e=(0,o.__)("Product List","woocommerce-google-analytics-integration")})=>!!t&&{items:[r(t,e)]},h=({order:t})=>void 0!==t&&{transaction_id:t.id,affiliation:t.affiliation,currency:t.totals.currency_code,value:i(t.totals.total_price,t.totals.currency_minor_unit),tax:i(t.totals.tax_total,t.totals.currency_minor_unit),shipping:i(t.totals.shipping_total,t.totals.currency_minor_unit),items:t.items.map(n)},k="woocommerce-google-analytics",A="experimental__woocommerce_blocks";(0,c.removeAction)(`${A}-checkout-submit`,k),(0,c.removeAction)(`${A}-checkout-set-email-address`,k),(0,c.removeAction)(`${A}-checkout-set-phone-number`,k),(0,c.removeAction)(`${A}-checkout-set-billing-address`,k),(0,c.removeAction)(`${A}-cart-set-item-quantity`,k),(0,c.removeAction)(`${A}-product-search`,k),(0,c.removeAction)(`${A}-store-notice-create`,k);const E={statistics:["analytics_storage"],marketing:["ad_storage","ad_user_data","ad_personalization"]};function $(){(({tracker_function_name:t})=>{if("function"==typeof wp_has_consent){void 0===window.wp_consent_type&&(window.wp_consent_type="optin");const e={};for(const[t,o]of Object.entries(E))if(""!==consent_api_get_cookie(window.consent_api.cookie_prefix+"_"+t)){const c=wp_has_consent(t)?"granted":"denied";o.forEach((t=>{e[t]=c}))}Object.keys(e).length>0&&window[t]("consent","update",e)}})(window.ga4w.settings),(({tracker_function_name:t})=>{document.addEventListener("wp_listen_for_consent_change",(e=>{const o={},c=E[Object.keys(e.detail)[0]],n="allow"===Object.values(e.detail)[0]?"granted":"denied";void 0!==c&&(c.forEach((t=>{o[t]=n})),Object.keys(o).length>0&&window[t]("consent","update",o))}))})(window.ga4w.settings);const t=function({events:t,tracker_function_name:o}){return function(c){const n=e[c];if("function"!=typeof n)throw new Error(`Event ${c} is not supported.`);return function(e){const r=n(e);t.includes(c)&&r&&window[o]("event",c,r)}}}(window.ga4w.settings);!function(t,{events:e,cart:o,products:c,product:n,added_to_cart:r,order:i}){Object.values(null!=e?e:{}).forEach((e=>{"add_to_cart"===e?t(e)({product:r}):t(e)({storeCart:o,products:c,product:n,order:i})}));const a=document.body.onadded_to_cart;document.body.onadded_to_cart=function(e,r,i,d){"function"==typeof a&&a.apply(this,arguments);const s=parseInt(d[0].dataset.product_id||d[0].value),u=n?.id===s?n:l(parseInt(s),c,o);u&&t("add_to_cart")({product:u})};const d=()=>{document.querySelectorAll(".woocommerce-cart-form .woocommerce-cart-form__cart-item .remove[data-product_id]").forEach((t=>t.addEventListener("click",s)))};function s(e){t("remove_from_cart")({product:l(parseInt(e.target.dataset.product_id),c,o)})}d();const u=document.body.onupdated_wc_div;document.body.onupdated_wc_div=function(){"function"==typeof u&&u.apply(this,arguments),d()};const _=document.body.onremoved_from_cart;document.body.onremoved_from_cart=function(){"function"==typeof _&&_.apply(this,arguments),s({target:arguments[3][0]})},document.querySelectorAll(".products .product:not(.wp-block-post)")?.forEach((e=>{const n=e.querySelector("a[data-product_id]")?.getAttribute("data-product_id");n&&e.addEventListener("click",(e=>{const r=e.target.closest(".woocommerce-loop-product__link"),i=e.target.classList.contains("button")&&e.target.hasAttribute("data-product_id"),a=e.target.classList.contains("add_to_cart_button")&&!e.target.classList.contains("product_type_variable");(r||i&&!a)&&t("select_content")({product:l(parseInt(n),c,o)})}))})),document.querySelectorAll(".products-block-post-template .product, .wc-block-product-template .product")?.forEach((e=>{const n=e.querySelector("[data-product_id]")?.getAttribute("data-product_id");n&&e.addEventListener("click",(e=>{const r=e.target,i=r.closest(".wc-block-components-product-image a"),a=r.closest(".wp-block-post-title a"),d=r.closest(".wc-block-components-product-button [data-product_id]");d&&d.classList.contains("add_to_cart_button")&&!d.classList.contains("product_type_variable")?t("add_to_cart")({product:l(parseInt(n),c,o)}):(i||d||a)&&t("select_content")({product:l(parseInt(n),c,o)})}))}))}(t,window.ga4w.data),(t=>{a(`${A}-product-render`,k,t("view_item")),a(`${A}-cart-remove-item`,k,t("remove_from_cart")),a(`${A}-checkout-render-checkout-form`,k,t("begin_checkout")),a(`${A}-cart-add-item`,k,(({product:e})=>{t("add_to_cart")({product:e})})),a(`${A}-product-list-render`,k,t("view_item_list")),a(`${A}-product-view-link`,k,t("select_content"))})(t)}function L(){window.ga4w||console.warn("Google Analytics for WooCommerce: Configuration and tracking data not found after the page was fully loaded. Make sure the `woocommerce-google-analytics-integration-data` script gets eventually loaded.")}window.ga4w?$():(document.addEventListener("ga4w:ready",$),"complete"===document.readyState?L():window.addEventListener("load",L))})();1 (()=>{"use strict";var t={d:(e,o)=>{for(var ))})(); -
woocommerce-google-analytics-integration/trunk/changelog.txt
r3106905 r3110812 1 1 *** Changelog *** 2 3 4 5 6 2 7 3 8 = 2.1.3 - 2024-06-25 = -
woocommerce-google-analytics-integration/trunk/includes/class-wc-google-analytics.php
r3103953 r3110812 205 205 $this->method_description .= "<div class='notice notice-info'><p>" . __( 'Please allow Google Analytics 24 hours to start displaying results.', 'woocommerce-google-analytics-integration' ) . '</p></div>'; 206 206 207 // phpcs: disable WordPress.Security.NonceVerification.Recommended207 // phpcs:e WordPress.Security.NonceVerification.Recommended 208 208 if ( isset( $_REQUEST['woocommerce_google_analytics_ga_ecommerce_tracking_enabled'] ) && true === (bool) $_REQUEST['woocommerce_google_analytics_ga_ecommerce_tracking_enabled'] ) { 209 209 $this->method_description .= "<div class='notice notice-info'><p>" . __( 'Please note, for transaction tracking to work properly, you will need to use a payment gateway that redirects the customer back to a WooCommerce order received/thank you page.', 'woocommerce-google-analytics-integration' ) . '</div>'; -
woocommerce-google-analytics-integration/trunk/readme.txt
r3106905 r3110812 4 4 Requires at least: 6.2 5 5 Tested up to: 6.5 6 Stable tag: 2.1. 36 Stable tag: 2.1. 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 49 49 == Changelog == 50 50 51 52 53 54 55 51 56 = 2.1.3 - 2024-06-25 = 52 57 * Add - WooCommerce Product Bundles integration. … … 56 61 * Tweak - Do not replace other extensions' `add_to_cart` listeners. 57 62 58 = 2.1.1 - 2024-06-12 =59 * Tweak - Confirm WC_Cart is available before formatting cart data.60 * Tweak - WC 9.0 compatibility.61 62 63 [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-google-analytics-integration/trunk/changelog.txt). -
woocommerce-google-analytics-integration/trunk/woocommerce-google-analytics-integration.php
r3106905 r3110812 6 6 * Author: WooCommerce 7 7 * Author URI: https://woocommerce.com 8 * Version: 2.1. 38 * Version: 2.1. 9 9 * WC requires at least: 8.4 10 10 * WC tested up to: 9.0 … … 25 25 if ( ! class_exists( 'WC_Google_Analytics_Integration' ) ) { 26 26 27 define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_VERSION', '2.1. 3' ); // WRCS: DEFINED_VERSION.27 define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_VERSION', '2.1.' ); // WRCS: DEFINED_VERSION. 28 28 define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_MIN_WC_VER', '6.8' ); 29 29
Note: See TracChangeset
for help on using the changeset viewer.