Skip to content

Commit

Permalink
Added GA4 Checkout Journey Woocommerce listeners, Bing UETQ tracking …
Browse files Browse the repository at this point in the history
…update
  • Loading branch information
chrisblakley committed Jan 23, 2025
1 parent 42e115d commit 461de47
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nebula-wp",
"title": "Nebula",
"description": "Advanced Starter WordPress Theme for Developers",
"version": "12.8.17.564",
"version": "12.8.23.408",
"homepage": "https://gearside.com/nebula/",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion Nebula-Child/assets/css/admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Nebula-Child/resources/sw.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//BEGIN automated edits. These will be automatically overwritten.
const THEME_NAME = 'nebula-child';
const NEBULA_VERSION = 'v12.8.17.564'; //Friday, January 17, 2025 1:31:49 PM
const NEBULA_VERSION = 'v12.8.23.408'; //Thursday, January 23, 2025 9:47:36 AM
const OFFLINE_URL = 'https://nebula.gearside.com/offline/';
const OFFLINE_IMG = 'https://nebula.gearside.com/wp-content/themes/Nebula-main/assets/img/offline.svg';
const META_ICON = 'https://nebula.gearside.com/wp-content/themes/Nebula-main/assets/img/meta/android-chrome-512x512.png';
Expand Down
4 changes: 2 additions & 2 deletions Nebula-Child/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/critical.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/login.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/pre.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion assets/js/modules/measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,25 @@ nebula.ecommerceTracking = async function(){
nebula.crm('event', 'Ecommerce Started Checkout Form');
});

//Note: Google Analytics for Woocommerce plugin does not send "add_shipping_info" nor "add_payment_info" events as of January 2025 so we need to handle those with Nebula here
if ( jQuery('#checkout').length ){ //If we are on the Checkout page
//Monitor for shipping method selection (for the Checkout Journey report)
nebula.dom.document.on('change', '.woocommerce-shipping-fields input, input#ship-to-different-address-checkbox, input[name="shipping_address_1"], input[name="shipping_method"]', function(){
gtag('event', 'add_shipping_info');
});

//Monitor for payment method selection (for the Checkout Journey report). Note: Stripe input fields are within an iframe!
nebula.dom.document.on('change', '#payment input, input[name="payment_method"]', function(){
gtag('event', 'add_payment_info');
});
nebula.dom.document.on('mouseover', '.payment_methods', function(){ //This helps when iframes exist within the payment methods section
nebula.once(function(){
gtag('event', 'add_payment_info');
nebula.dom.document.off('mouseover', '.payment_methods'); //Remove the listener once it occurs
}, 'add payment info');
});
}

//Place order button
nebula.dom.document.on('pointerdown', '#place_order', function(e){
let thisEvent = {
Expand Down Expand Up @@ -1836,7 +1855,7 @@ nebula.fbq = function(type='track', eventName='', parameters={}){

//Bing conversion tracking
nebula.uetq = function(parameters={}){
if ( typeof uetq === 'function' ){
if ( window.uetq && typeof window.uetq.push === 'function' ){
window.uetq.push(parameters);
}
};
Expand Down
2 changes: 1 addition & 1 deletion assets/js/modules/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ nebula.uniqueId = function(prefix='nuid', random=false){
nebula.once = function(fn, args, unique){
nebula.onces = nebula.onces || {};

if ( typeof args === 'string' ){ //If no parameters
if ( typeof args === 'string' ){ //If no parameters, treat it as the unique string
unique = args;
args = [];
}
Expand Down
2 changes: 1 addition & 1 deletion assets/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Theme URI: https://nebula.gearside.com
Description: Nebula is a springboard WordPress theme framework for developers. Like other WordPress startup themes, it has custom functionality built-in (like shortcodes, styles, and JS/PHP functions), but unlike other themes Nebula is not meant for the end-user.
Author: Nebula
Version: 12.8.17.564
Version: 12.8.23.408
License: GNU General Public License v2.0 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nebula
Expand Down
2 changes: 1 addition & 1 deletion inc/data/nebula_theme.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "12.8.17.564",
"version": "12.8.23.408",
"details_url": "https://github.com/chrisblakley/Nebula/commits/main",
"download_url": "https://github.com/chrisblakley/Nebula/archive/main.zip"
}
4 changes: 4 additions & 0 deletions inc/data/php_timeline.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[{
"8.4": {
"security": "31 Dec 2026",
"end": "31 Dec 2028"
},
"8.3": {
"security": "31 Dec 2025",
"end": "31 Dec 2027"
Expand Down
Loading

0 comments on commit 461de47

Please sign in to comment.