Accessing DL within filter ‘gtm4wp_compile_datalayer’
-
Hi,
I found this great snippet to add order profit to the GTM4WP dataLayer:
https://gist.github.com/mattiasghodsian/b473d5cd7762fd9d8588fb5122033f51
However it fails trying to retrieve order data from the dataLayer:
$orderID = $dataLayer['ecommerce']['purchase']['actionField']['id']; $orderItems = $dataLayer['ecommerce']['purchase']['products'];
Resulting in error because this array seems to be empty:
<strong>Notice:</strong> Undefined index: ecommerce
My question is:
Is it possible to retrieve the orderID and orderItems from the dataLayer with this filter? So I can make this snippet work?
Looking forward to your reply. Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Accessing DL within filter ‘gtm4wp_compile_datalayer’’ is closed to new replies.