Learn

You can now wield SQL to find where, when, and how users are visiting a website. Well done! Here’s a summary of what you learned:

  • UTM parameters are a way of tracking visits to a website. Developers, marketers, and analysts use them to capture information like the time, attribution source, and attribution medium for each user visit.
  • First-touch attribution only considers the first source for each customer. This is a good way of knowing how visitors initially discover a website.
  • Last-touch attribution only considers the last source for each customer. This is a good way of knowing how visitors are drawn back to a website, especially for making a final purchase.
  • Find first and last touches by grouping page_visits by user_id and finding the MIN and MAX of timestamp.
  • To find first- and last-touch attribution, join that table back with the original page_visits table on user_id and timestamp.

Instructions

Make sure you feel comfortable with the attribution query before moving on.

If you need to practice here or go back through the lesson, go ahead!

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?