Conversation
There was a problem hiding this comment.
Include a page view in here as well.
There was a problem hiding this comment.
Was thinking of commenting on the GA code too for this.
@allendav @dereksmart - We have previously looked at manually sending a product view event when an add-to-cart event is triggered from a list (eg. shop) page so that you can never have a 0 view -> 1 cart -> 1 purchase funnel. What do you think?
|
Do you think its worth it to integrate this code into the existing GA module? We could rename it, of course. |
There was a problem hiding this comment.
Seems like this would be the ideal place to do all the checks for isActiveStore or WooCommerce is indeed installed.
There was a problem hiding this comment.
Good idea, I also noted the repeated checks to WooCommerce above.
|
I pulled this branch down and the code doesn't seem to be included when I hit the page. Any tips? EDIT: I threw this in a random place to get it to work: |
There was a problem hiding this comment.
Since this is an internal tool, lets drop the # from the id and remove references to sku, which won't be needed
There was a problem hiding this comment.
By listening to the added_to_cart Woo event, we can fire our added to cart event when the server returns without errors on the callback.
jQuery('body').on('added_to_cart',function(){
// call track event here
}Is there an advantage to sending the event as soon as the user clicks the button?
There was a problem hiding this comment.
The same situation for "remove from cart"
There was a problem hiding this comment.
Except that event isn't fired for the non-async add-to-cart, is it?
There was a problem hiding this comment.
That right. The add_to_cart function above still has to handle non-async
|
Should we also track |
Thought about this a lot. Very happy to do that but I am concerned that GA is only available to premium users and we want to activate our module for all connected sites. Perhaps we can make some of the code usable for both modules? |
I'm not 100% clear on how to properly set up the module across Jetpack. I did get it to work by reading this - https://jetpack.com/support/control-jetpacks-modules-on-one-page/ Although the WooCommerce Analytics module appears and then disappears and then has a blank name once the page loads. |
Yes, eventually. My initial thought is let's get the basic cart tracking working so we can look at the back end analysis and then we can catch up on the front end edge cases. We should add it to our backlog. I guess we are interested in firing a remove from cart event when the quantity is updated to 0? We don't really care if it goes from 6 to 5, right? |
64acc65 to
eb2a1af
Compare
a5ec9d3 to
fa80140
Compare
|
Is this using our analytics, or GA? If it is ours, why not just add this to the existing stats module? |
Ours
This is what we had originally, but the idea is to allow the user to turn it off, should they choose. |
Checkout Process UpdateGA uses add_action( 'woocommerce_after_checkout_form', array( $this, 'checkout_process' ) );This appears to be a bug because the code is run on the checkout screen, but before the user clicks on "Place Order". @allendav, am I reading this correctly? It seems these jetpack/modules/google-analytics/classes/wp-google-analytics-universal.php Lines 374 to 394 in eb3c3e3 We could use this opportunity to place a click event on the "Place Order" button, but if form validation fails its not really a placed order. Alternatively, we can use @greenafrican, this is where I'm at and I've run out of time for today, so I pushed my progress even though its not complete. |
|
Thanks @psealock I managed to do a bit of testing on this yesterday too.
I see they are tracking a I've wondered whether or not we should track We could use the |
7a03dc2 to
16352e5
Compare
|
I've updated the branch @psealock take a look and let me know what you think. |
|
Do you think I could have missed something? I eventually toggled everything in calypso for the advanced analytics for ecommerce |
Sounds like your setup should have worked just fine. I've tested the code in a variety of formats - stand-alone plugin, bundled with |
|
Thank you! |
|
Maybe it would be great to rebase this against latest master. The code is not conflicting, but a few releases have been out since this PR was opened. Relabeling as in need of author reply. When we're set please move to needs review again. |
|
@oskosk The behaviour you describe is the desired result. At the time of writing the testing instructions in the original comment,
Thats correct, we're only tracking users' users
Yup, thats right
You should be able to see events in the Network tab. I will update the test instructions and rebase from master now. Thanks again and sorry for the confusion. |
… analytics enhancements
2b8c138 to
0a25c99
Compare
|
awesome, thank you @psealock ! |
|
I'm merging this and opening an issue about it if I get to reproduce the problem again. |
* update changelog.txt * Update readme.txt with scaffolding for 5.9 changelog and release draft shortlink * Add changelog entry for #8243 * Add changelog entry for #8296 * Add changelog entry for #8367 * Add changelog entry for #8686 * Add changelog entry for #8707 * Add changelog entry for #8709 and #8714 * Add changelog entry for #8729 * Add changelog entry for #8777 * Add changelog entry for #8780 * Add changelog entry for #8786 * Add changelog entry for #8787 * Add changelog entry for #8801 #8805 #8832 #8865 and #8804 * Add changelog entry for #8817 * Add changelog entry for #8822 * Add changelog entry for #8823 * Add changelog entry for #8829 * Add changelog entry for #8834 * move some items to major enhancements * Add changelog entry for #8836 * Add changelog entry for #8839 * Add changelog entry for #8861 * Add changelog entry for #8862 * Add changelog entry for #8863 * Add changelog entry for #8866 * Add changelog entry for #8870 * Add changelog entry for #8874 * Add changelog entry for #8875 * Add changelog entry for #8881 * Add changelog entry for #8890 * Add changelog entry for #8911 * Add changelog entry for #8927 * Add changelog entry for #8931 * Add changelog entry for #8933 * Add changelog entry for #8930 * fix wording * typo * minor fixes * replace partner scripts for Jetpack Start in changelog entry * Update to-test.md * Update to-test.md * minor style fixes to to-test.md * minor style fixes to to-test.md * minor fixes on to-test.md * Add changelog entry for #8868 * Add changelog entry for #8844 * Add changelog entry for #8664 * Add changelog entry for #8935 * Add changelog entry for #8425 * Add changelog entry for #8625

New module with WooCommerce analytics ported from the recent Google Analytics enhancements.
Changes proposed in this Pull Request:
Testing instructions:
https://stats.wp.com/s-20180821.json public facing pages. The20180821is dynamic and will change based on datehttps://stats.wp.com/s-20180821.jsis not requested onwp-adminpages because this code should not run on admin facing pages. The same for logged in admin users._wcaglobal exists and is anarrayobject.Product Page View
t.gifAdd to Cart via a list
t.gifAdd to Cart via a Product Page
t.gifRemove from Cart via click on the "X"
t.gifRemove from Cart via updating the quantity
t.gifOrder Received
Legend
_en: event namepi: product idpn: product namepq: product quantitypc: product categorypp: product priceoi: order idChangelog entry