Skip to content

Commit

Permalink
Add Page Visits Funnel analysis for Cool T-Shirts Inc.
Browse files Browse the repository at this point in the history
  • Loading branch information
AxelHolst committed Jul 26, 2024
1 parent 964e506 commit 2b64a95
Show file tree
Hide file tree
Showing 8 changed files with 4,127 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Import all the files"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
"visits = pd.read_csv('visits.csv',\n",
" parse_dates=[1])\n",
"cart = pd.read_csv('cart.csv',\n",
" parse_dates=[1])\n",
" \n",
"checkout = pd.read_csv('checkout.csv',\n",
" parse_dates=[1])\n",
"purchase = pd.read_csv('purchase.csv',\n",
" parse_dates=[1])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 1: Inspect the DataFrames using `print` and `head`"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" user_id visit_time\n",
"0 943647ef-3682-4750-a2e1-918ba6f16188 2017-04-07 15:14:00\n",
"1 0c3a3dd0-fb64-4eac-bf84-ba069ce409f2 2017-01-26 14:24:00\n",
"2 6e0b2d60-4027-4d9a-babd-0e7d40859fb1 2017-08-20 08:23:00\n",
"3 6879527e-c5a6-4d14-b2da-50b85212b0ab 2017-11-04 18:15:00\n",
"4 a84327ff-5daa-4ba1-b789-d5b4caf81e96 2017-02-27 11:25:00\n",
" user_id cart_time\n",
"0 2be90e7c-9cca-44e0-bcc5-124b945ff168 2017-11-07 20:45:00\n",
"1 4397f73f-1da3-4ab3-91af-762792e25973 2017-05-27 01:35:00\n",
"2 a9db3d4b-0a0a-4398-a55a-ebb2c7adf663 2017-03-04 10:38:00\n",
"3 b594862a-36c5-47d5-b818-6e9512b939b3 2017-09-27 08:22:00\n",
"4 a68a16e2-94f0-4ce8-8ce3-784af0bbb974 2017-07-26 15:48:00\n",
" user_id checkout_time\n",
"0 d33bdc47-4afa-45bc-b4e4-dbe948e34c0d 2017-06-25 09:29:00\n",
"1 4ac186f0-9954-4fea-8a27-c081e428e34e 2017-04-07 20:11:00\n",
"2 3c9c78a7-124a-4b77-8d2e-e1926e011e7d 2017-07-13 11:38:00\n",
"3 89fe330a-8966-4756-8f7c-3bdbcd47279a 2017-04-20 16:15:00\n",
"4 3ccdaf69-2d30-40de-b083-51372881aedd 2017-01-08 20:52:00\n",
" user_id purchase_time\n",
"0 4b44ace4-2721-47a0-b24b-15fbfa2abf85 2017-05-11 04:25:00\n",
"1 02e684ae-a448-408f-a9ff-dcb4a5c99aac 2017-09-05 08:45:00\n",
"2 4b4bc391-749e-4b90-ab8f-4f6e3c84d6dc 2017-11-20 20:49:00\n",
"3 a5dbb25f-3c36-4103-9030-9f7c6241cd8d 2017-01-22 15:18:00\n",
"4 46a3186d-7f5a-4ab9-87af-84d05bfd4867 2017-06-11 11:32:00\n"
]
}
],
"source": [
"print(visits.head(5))\n",
"print(cart.head(5))\n",
"print(checkout.head(5))\n",
"print(purchase.head(5))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 2: Left merging visits and cart"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 3: How long is `visits_cart`?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 4: How many timestamps are null for `cart_time`?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 5: What percentage only visited?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 6: What percentage placed a t-shirt in their cart but did not checkout?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 7: Merge it all together"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 8: % of users who got to checkout but did not purchase"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 9: check each part of the funnel, let's print all 3 of them again"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*The weakest part of the funnel is clearly getting a person who visited the site to add a tshirt to their cart. Once they've added a t-shirt to their cart it is fairly likely they end up purchasing it. A suggestion could be to make the add-to-cart button more prominent on the front page.*\n",
"\n",
"\n",
"Step 10: adding new column"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 11: examine the results"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 12: average time to purchase"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading

0 comments on commit 2b64a95

Please sign in to comment.