Add Ecommerce Items to DataLayer outside of WooCommerce
-
Hi Thomas,
Thank you for the huge effort you’ve put into this plugin. I’m a designer/developer, and this has saved me countless hours!
I’m successfully using the
gtm4wp_compile_datalayer
filter to add info from Paid Memberships Pro signups to the DataLayer and send it off to Facebook, which is working great.I would like to send this same data to GA4 as an Ecommerce event, similar to what’s already built into GTM4WP for WooCommerce.
The
gtm4wp_compile_datalater
filter allows me to add single-line items, but I am wondering how I can add a nested chunk of data formatted for GA4 e-commerce?Here’s an example of my desired code to be added to dataLayer():
ecommerce: { currency: 'USD', value: 19.99, items: [{ item_name: 'Platinum Membership', price: '19.99', quantity: '1' }] }
Thank you for any guidance you can provide. Cheers.
- The topic ‘Add Ecommerce Items to DataLayer outside of WooCommerce’ is closed to new replies.