WooCommerce Analytics: Queue add_to_cart Events#9052
Conversation
add_to_cart Events
4793a0f to
dacc670
Compare
timmyc
left a comment
There was a problem hiding this comment.
Some quick comments, will run some further tests shortly and report back.
There was a problem hiding this comment.
minor but space between ! empty
There was a problem hiding this comment.
Indentation is a little wonky right here.
There was a problem hiding this comment.
Also noting from our convo today - how will this bit of logic respond to a quick add event from a product listing page?
There was a problem hiding this comment.
Good point. It captures the add_to_cart action properly -- but it does also fire off a view which might not be accurate in this case.
There was a problem hiding this comment.
yes, adding a product from the product page results in 2 product_views and one add-to-cart
if the referring post is not a product OR the product being added is not the same as post
(eg. related product list on single product page) then include a product view event
This is correct, and when I step through the code, this portion behaves as expected. Digging further, the extra page view is from the page refresh, and you can see that working in the master branch.
@greenafrican Since we are utilizing session, in capture_product_view we can check to see if a product_view is about to be dropped. This may depend on timing. Is it worth exploring?
There was a problem hiding this comment.
Digging further, the extra page view is from the page refresh
Yes, I had an extra check to prevent these but removed it yesterday as it can cause other issues down the line. For example, if the user continues to add_to_cart we log all the additional add_to_cart events but no further product_views. It is not ideal/perfect as is but I'd rather there were a few extra product_views than have a situation where there can be more add_to_carts than product_views. The more I think about this the more I wonder if we don't need to move to reporting on uniques rather than simple counts.
There was a problem hiding this comment.
how will this bit of logic respond to a quick add event from a product listing page?
@timmyc It will add both a product_view and an add_to_cart event, which is what we want.
It captures the add_to_cart action properly -- but it does also fire off a view which might not be accurate in this case.
@justinshreve My thoughts are that we do want the product_view here for 2 reasons: 1) we don't want a situation where we have more add_to_cart events than product_views in a funnel, 2) I feel as though, by clicking add_to_cart, the user has 'looked' at the product.
There was a problem hiding this comment.
spacing a bit off here too.
|
/cc @justinshreve - would be keen to have you 👀 this PR if you have some time. |
emdashcodes
left a comment
There was a problem hiding this comment.
A few comments. Events seem to be firing correctly.
There was a problem hiding this comment.
Minor: I'm not a fan of having each argument on it's own line here.
There was a problem hiding this comment.
$product is an object, not an array.
There was a problem hiding this comment.
Good point. It captures the add_to_cart action properly -- but it does also fire off a view which might not be accurate in this case.
There was a problem hiding this comment.
$cart_item_key is unused in this function
send product view events for products added to cart from any list or non-product detail page
…non-product detail page
eefb048 to
4ec0832
Compare
|
Any ideas why 88e8644 broke the build for this branch? |
|
It probably just needs a restart - I restarted two failed jobs, let's see what happens. |
|
Thanks @zinigor |
|
Thanks for the reviews @timmyc @psealock @justinshreve Fixes included in the latest squashed commit:
|
|
@jeherve Would you mind reviewing this PR, to be included in v5.9.1 if possible? |
|
@psealock @timmyc @justinshreve would you mind doing another review of this? |
psealock
left a comment
There was a problem hiding this comment.
Gave this another run through. Works as expected, didn't find anything odd.
* Changelog 6.0: create base for changelog. * Add #8938 to changelog * Add #8962 to changelog * Add #8974 to changelog * Add #8975 to changelog * Add #8978 to changelog * Add #8867 to changelog * Add #8937 to changelog * Add #8961 to changelog * Add #8855 to changelog * Add #8944 to changelog * Add #8973 to changelog * Add #8977 to changelog * Add #8979 to changelog * Add #8980 to changelog * Add #8982 to changelog * Add #8983 to changelog * Add #8984 to changelog * Add #8986 to changelog * Add #9005 to changelog * Add #9010 to changelog * Add #9012 to changelog * Add #9021 to changelog * Add #9022 to changelog * Add #9056 to changelog * Add #9061 to changelog * Add #9079 to changelog * Add #9080 to changelog * Add #9088 to changelog * Add #9096 to changelog * Add #9097 to changelog * Add #9100 to changelog * Add #9107 to changelog * Add #8969 to changelog * Add #8993 to changelog * Add #9003 to changelog * Add #9031 to changelog * Add #8945 to changelog * Add #9052 to changelog * Add #9058 to changelog * Add #9066 to changelog * Add #9076 to changelog * Add #9053 to changelog * Add #9108 to changelog * Add #9135 to changelog * Add #9148 to changelog * Add #9125 to changelog * Add #9137 to changelog * Added testing instructions for 6.0. * Added IS testing instructions, huge props to @tiagonoronha. * Added #8498 to changelog. * Added #8954 to changelog. * Added #8985 to changelog. * add #9027 * add #9112 to changelog * add #9136 to changelog * add #9102 to changelog * add #9093 to changelog * add #9062 to changelog * add #9172 to changelog
Fixes #9049
Changes proposed in this Pull Request:
add_to_cartevents and logging on the next pageproduct_viewevents from product pageTesting instructions:
http://exampleshop.com/?add-to-cart=${product_id}Proposed changelog entry for your changes:
WooCommerce Analytics: Start tracking all possible ways to add a product to a cart