English subtitles

← Checkout steps code

Get Embed Code
4 Languages

Showing Revision 3 created 05/25/2016 by Udacity Robot.

  1. As your user progresses through
    the steps in the checkout process,
  2. your app needs to send
    an analytics hit for each step.
  3. However, you only need one checkout hit.
  4. So subsequent steps in the checkout
    process, send checkout option hits.
  5. So that you don't over report
    the number of checkouts.
  6. And use the setCheckoutStep
    method to set the step number.
  7. And you can set the number
    to whatever you want, but
  8. it only shows up in the checkout
    behavior analysis report in
  9. the google analytics dashboard
    if you set a funnel step for it.
  10. If i set the step in the code to 99, but
    I've only labeled 4 checkouts steps in
  11. the admin console, I will never see
    the 99th step in the dashboard, so
  12. that's just not a good idea.
  13. That's better.
  14. So go ahead and add a second step to
    the checkout process for the dinner app.
  15. For that you're going to
    need a payment button.
  16. So add another button to the order
    dinner screen labelled payment.
  17. And in the order dinner activity,
    add the method to get the payment info.
  18. Then send a step two hit to analytics.
  19. Make sure to set the action
    to an ACTION_CHECKOUT_OPTION.
  20. Show the payment button
    only when relevant and
  21. hide the other buttons when
    the payment button appears.
  22. Test your app and try it out.
  23. And in the analytics dashboard,
    look for the realtime activity.
  24. And in the realtime activity,
    check for the events.
  25. See, here's the Get payment step.
  26. It might take a good amount of time
    after you see the realtime hits for
  27. the checkout behavior
    analysis page to update.
  28. But when it does,
    you should see your new payment step.
  29. Oh, something went wrong.
  30. I got a hit for getting the address,
    but not forgetting the payment details.
  31. That's not what I wanted.
  32. Okay that happened because step
    one is starting checkout and
  33. step two is getting the address.
  34. Step three is getting
    the payment details.
  35. That's easy to fix for now.
  36. Go to Admin > Ecommerce, and
  37. I'm just going to remove
    the Get address final step.
  38. Yep, I'll delete this rule.
  39. And submit, and go back to Reporting,
    and look at that.
  40. The get address step is gone,
    and I've got my payment details.
  41. And I know that that is correct,
    in this case.
  42. An alternative would be to change
    the step number to three in the code.
  43. But then we would be
    skipping over step two.
  44. So we would have values here,
    nothing here, values here.
  45. So when you set your check out step in
    the code, you need to make sure that it
  46. mapped the correct final step
    in the analytic dashboard.
  47. So make sure step two is in fact
    the payment step, and if not, fix it.
  48. So go ahead and do these steps and
    check the boxes when you're done.