" Product Quantity" value not populating in the Product Syntax for the "scView" event. | Community
Skip to main content
V_Pavan
Level 2
July 24, 2023
Solved

" Product Quantity" value not populating in the Product Syntax for the "scView" event.

  • July 24, 2023
  • 1 reply
  • 1921 views

Hey, I implemented the below code under the custom code editor in the rule but I am not able to get the value for the "Product Quantity" in the network call, it's coming as undefined in the network call. 

What might be the issue?

s.events = apl(s.events, "scView");

s.linkTrackVars = "events,products";

s.linkTrackEvents = "scView,purchase";

s.products = ";"+ _satellite.getVar('Product Id') + ";" +_satellite.getVar('Product Quantity') + ";" +_satellite.getVar('Product Price')

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jennifer_Dungan

Even if you manage to send the quantity on your "Shopping Cart View" the data will be ignored... Quantity only applies to hits with the purchase event.

 

It's possible that Launch (AppMeasurement) is removing it during the beacon bundling because it's not a valid field in this context (but that seems unlikely)....  Same with Product Price... these are only relevant on purchases... this is the data that builds your revenue metric...

 

if you have a product at $5.00 and the quantity is 3, then your revenue will increment by $15 (3 x 5). On anything other than a purchase you will be counting money as made that hasn't been made, and then when you send it on purchase, you will be double/triple/etc over counting the revenue depending on how many times the user opens their cart (which is why Adobe will just ignore these values during processing, regardless of if they are sent or not)

 

 

That said, if only quantify is undefined then you might want to check your Product Quantity data element... but again, fixing this context is a moot point....

 

For more information about Products, please see https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/products.html?lang=en 

 

 

Now, if you really want to see interim values for quantity and how much money is sitting in the cart, then I suggest you set up some merchandising eVars for this purpose... and if your Data Element isn't working, you will still need to investigate what is causing it to fail.

 

I would start by opening your cart, opening your console and running this:

_satellite.getVar('Product Quantity');

 

Then you will be able to see what this data element is returning, then start digging into debugging your data element.

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Jennifer_DunganCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
July 24, 2023

Even if you manage to send the quantity on your "Shopping Cart View" the data will be ignored... Quantity only applies to hits with the purchase event.

 

It's possible that Launch (AppMeasurement) is removing it during the beacon bundling because it's not a valid field in this context (but that seems unlikely)....  Same with Product Price... these are only relevant on purchases... this is the data that builds your revenue metric...

 

if you have a product at $5.00 and the quantity is 3, then your revenue will increment by $15 (3 x 5). On anything other than a purchase you will be counting money as made that hasn't been made, and then when you send it on purchase, you will be double/triple/etc over counting the revenue depending on how many times the user opens their cart (which is why Adobe will just ignore these values during processing, regardless of if they are sent or not)

 

 

That said, if only quantify is undefined then you might want to check your Product Quantity data element... but again, fixing this context is a moot point....

 

For more information about Products, please see https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/products.html?lang=en 

 

 

Now, if you really want to see interim values for quantity and how much money is sitting in the cart, then I suggest you set up some merchandising eVars for this purpose... and if your Data Element isn't working, you will still need to investigate what is causing it to fail.

 

I would start by opening your cart, opening your console and running this:

_satellite.getVar('Product Quantity');

 

Then you will be able to see what this data element is returning, then start digging into debugging your data element.

V_Pavan
V_PavanAuthor
Level 2
July 25, 2023

Hey @jennifer_dungan as you see I have also included the " _satellite.getVar('Product Id')" & "_satellite.getVar('Product Price')" in the code and these are also being passed via Data Elements, and I am getting the value's of "Product Id" & "Product Price" in the cart view but not the Product Quantity

I guess Product Quantity reflects only along with s.purchase event and not in scView or scOpen.

yuhuisg
Community Advisor
Community Advisor
July 25, 2023

In general, Analytics will only report on Units (product quantity), Revenue (product quantity x product price) and Orders/Transactions with the "purchase" event.

If you need to report on product quantity and product revenue at other ecommerce steps, then you will need to track them to your own success events. Then, modify your s.products string accordingly.

For example, if you've setup event10 to track product quantity and event11 to track product revenue, then your s.products string at the non-purchase ecommerce steps would be:

s.products = ";"+ _satellite.getVar('Product Id') + ";;;event10=" + parseInt(_satellite.getVar('Product Quantity'), 10) + "|event11=" + parseInt(_satellite.getVar('Product Quantity'), 10) * parseFloat(_satellite.getVar('Product Price'));