• Hello,

    I installed the version 1.13 of your plugin (and tested now with the 1.14) and setted GTM with this guide:

    In Analytics I see tracked events but the “add_to_cart” and “purchase” events do not contains the “revenue”.

    I see in the Google Tag Assistant that three events are fired:
    – “gtm4wp.addProductToCartECC” -> “No hits were sent by this container”
    – “Add To Cart” -> screenshot here
    – add_to_cart -> No hits were sent by this container

    In the Analytics DebugView I see an “add_to_cart” event and it seems to be ok (no errors are reported).

    Do you have any suggestion on what to check?
    Thanks for your help, Nicola.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter Nicola Modugno

    (@shark986)

    Nobody here? O:-)

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Nicola,

    Sorry for the late reply.
    Could you post the URL of your site so that I can have a look at the add to cart events?

    Thread Starter Nicola Modugno

    (@shark986)

    Hi Thomas, thank you for your reply.
    The site is https://www.paoul.com/

    Consider that for testing pourpose I modified your gtm4wp-woocommerce-enhanced.js script. To be honest, I think that there is a bug in that script (a GA4 event triggered inside a UA trigger event) but I do not remember the line.
    You should be able to download the modified script to check the differences.

    Hope to read soon from you!
    Thank you!!

    Thread Starter Nicola Modugno

    (@shark986)

    I found the line of the original script: 756 for the following code

    
    		// fire ga3 version
    		window[ gtm4wp_datalayer_name ].push({
    			'event': 'gtm4wp.productClickEEC',
    			'ecommerce': {
    				'currencyCode': gtm4wp_currency,
    				'click': {
    					'actionField': {'list': dom_productdata.getAttribute( 'data-gtm4wp_productlist_name' )},
    					'products': [ product_data ]
    				}
    			},
    			'eventCallback': function( container_id ) {
    				if (window.gtm4wp_first_container_id != container_id) {
    					// only call this for the first loaded container
    					return true;
    				}
    
    				// fire ga4 version
    				window[ gtm4wp_datalayer_name ].push({
    					'event': 'select_item',
    					'ecommerce': {
    						'currency': gtm4wp_currency,
    						'items': [ gtm4wp_map_eec_to_ga4( product_data ) ]
    					},
    					'eventCallback': function() {
    						if ( ctrl_key_pressed && productpage_window ) {
    							productpage_window.location.href = dom_productdata.getAttribute( 'data-gtm4wp_product_url' );
    						} else {
    							document.location.href = dom_productdata.getAttribute( 'data-gtm4wp_product_url' );
    						}
    
    					},
    					'eventTimeout': 2000
    				});
    			},
    			'eventTimeout': 2000
    		});
    
    Plugin Author Thomas Geiger

    (@duracelltomi)

    Thanks!

    Your Siteground optimize is loading a minified version of the mentioned JS file which makes is quite hard to compare what are the changes in your version.

    What I can see from the GTM debug tool is that you’ve added lots of extra data layer pushes to null the ecommerce variable. That is mentioned in Google’s docs since a while but the implementation in GTM4WP does not need this if you setup tracking the guide provided on the plugin website.

    Could you save a copy of your modifications and revert back to the original script?

    Thread Starter Nicola Modugno

    (@shark986)

    Here you can find the modified script:
    https://www.paoul.com/wp-content/plugins/duracelltomi-google-tag-manager/js/gtm4wp-woocommerce-enhanced.js

    What I can see from the GTM debug tool is that you’ve added lots of extra data layer pushes to null the ecommerce variable. That is mentioned in Google’s docs since a while but the implementation in GTM4WP does not need this if you setup tracking the guide provided on the plugin website.

    You are right. That was a try!

    Thread Starter Nicola Modugno

    (@shark986)

    Basically, I have commented out the GA3 pushes and added the currency to the ga4_product var at row 20

    
    	// default, required parameters
    	let ga4_product = {
    		'item_id': productdata.id ? productdata.id : '',
    		'item_name': productdata.name ? productdata.name : '',
    		'item_brand': productdata.brand ? productdata.brand : '',
    		'price': productdata.price ? productdata.price : "",
    		'currency': productdata.currency ? productdata.currency : gtm4wp_currency
    	};
    
    Plugin Author Thomas Geiger

    (@duracelltomi)

    Thanks!

    Could you revert it back to the original version to that I can check how your site behaves using it?

    Thread Starter Nicola Modugno

    (@shark986)

    Script reverted and excluded from minification!

    Plugin Author Thomas Geiger

    (@duracelltomi)

    I added a product into the cart and the add_to_cart event included the value:

    https://www.awesomescreenshot.com/image/23765885?key=9dad80d5973718e40c50c054985dd03f

    Thread Starter Nicola Modugno

    (@shark986)

    I see this details…
    In Analytics: https://tinyurl.com/ybvuyj3n
    (and I don’t understand the value 199000000)

    In the Tag assistant I see 2 events: do you know why?
    https://tinyurl.com/ycgvwmy4
    https://tinyurl.com/y7p5nwwq

    The problem is that I do not see the revenue in GA4 reports. The Google assistance team told me to check the currency….
    “Dopo aver fatto maggiori verifiche all´interno del suo account, ho potuto constatare che c’è da verificare che sia impostata la corretta valuta.”

    I do not what else to check…

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Revenue details missing in GA4’ is closed to new replies.