Skip to content

Instantly share code, notes, and snippets.

@charisTheo
Created September 11, 2020 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charisTheo/0976654c83bf95a7de26ad5b3dcdfb80 to your computer and use it in GitHub Desktop.
Save charisTheo/0976654c83bf95a7de26ad5b3dcdfb80 to your computer and use it in GitHub Desktop.
Use the script to measure navigation times throughout a user funnel (ex: Amazon) while prefetching each next page. Use the textbox in Script (tab) > Enter Script.
navigate https://www.amazon.co.uk/
setEventName LoadProductListingPage
navigate https://www.amazon.co.uk/s?k=sofa&ref=nb_sb_noss
setEventName ClickOnProduct
execAndWait var h=document.createElement("link");h.rel="prefetch";h.as="document";h.href="https://www.amazon.co.uk/Leisure-Zone-Ottoman-Furniture-Footstool/dp/B07XP25JDT/ref=mp_s_a_1_1_sspa";document.head.appendChild(h);
clickAndWait title=product-image
setEventName AddToCart
execAndWait var h=document.createElement("link");h.rel="prefetch";h.as="document";h.href="https://www.amazon.co.uk/gp/aw/c/ref=mw_dp_buy_crt";document.head.appendChild(h);
clickAndWait id=add-to-cart-button
setEventName GoToCheckout
execAndWait var h=document.createElement("link");h.rel="prefetch";h.as="document";h.href="https://www.amazon.co.uk/ap/signin";document.head.appendChild(h);
execAndWait actionCheckout()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment