diff --git a/includes/functions.php b/includes/functions.php index f2ebe00..b18d4d6 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -213,6 +213,11 @@ function pmproga4_checkout_events() { return; } + // Bail if the membership level is not set. + if ( empty( $pmpro_level ) ) { + return; + } + // Build an array of product data. $gtag_config_ecommerce_products = array(); $gtag_config_ecommerce_products['item_id'] = $pmpro_level->id;