by Len Epp
published Sep 08, 2015
A page view is sent to Google Analytics from Leanpub when a user lands on:
- Book landing page (/books/:slug)
- Bundle landing page (/bundles/:slug)
- Checkout complete page (/cart_purchase/:uuid/thankyou) [UPDATE 2018/09/11: A Leanpub author has suggested this worked for him: (/cart_purchases\:uuid/download)]
Just to be clear, ‘slug’ is your book’s or your bundle’s slug, so for the book https://leanpub.com/lean, the slug is ‘lean’.
Events in Google Analytics are broken up into 3 pieces: Category, Action, and Label (optional).
The events we send are as follows, using the category ‘ShoppingCart’, the actions ‘Added’, Removed’, and ‘MovedFromWishList’:
- ‘ShoppingCart’, ‘Added’, slug
- ‘ShoppingCart’, ‘Removed’, slug
- ‘ShoppingCart’, ‘MovedFromWishList’, slug
– Posted by Len Epp
Originally published at leanpub.com.