Now, I'd expect that there will be a lot more added to cart that had
been checked out, since it's cumulative.
Everything that's been added to cart,
the subset of that has actually been part of checkout.
Checkout is Number 6, so,
I want to include that here.
So, it looks like no action.
One, I think it's they viewed a product list.
I think I'm going to bring this in here,
just so I make sure I'm speaking the truth here.
Number 1 is the click-through lists.
Number 2 is they viewed the product detail.
Number 3 is they added to cart.
Four is that removed it from cart, interesting.
Some cool insights you can probably get there.
Like, I really don't want to talk for this anymore.
I should have bought it. Five is they've checked out completed purchases.
Number 6, they are in the checkout options still,
and unknown is zero.
Probably not engaged in the e-commerce pipeline yet.
Block comment that out, just so we have that for a little bit later.
Okay, so we know for each of them and the different types,
we have the mapping associated with each.
You saw, it was hard for me to memorize,
which each of these different steps are so,
is there a way that we can just associate the label with these,
without having to ingest a new table yet? We haven't covered that.
So, let's see if we can just do a,
if you've worked with case statements before,
we can definitely do that here.
So, let's say do a little bit of a mapping exercise here.
Case statement basically says,
it's a kind of chained if then together.
So, take a look at this field,
when it's zero, then do something, when it's one.
So, this is probably the most boring part of the video right here for you.
So, just bear with me. When it's three then,
and then when it's four then do something else,
when it's five, when it's six.
So, those of you who have already worked through the lab,
you'll probably notice the error that I'm building up for you here.
After that, we're going to say,
if it's not any of those,
throw an error, because we expected to have a value and that would be useful for us.
Then, we need to end the case,
I'm going to give an alias.
The whole thing that we're just going to call it eCommerceAction type,
give it a label.
Great, so now does that work?
Once that, it's not going to work,
it's not going to return anything.
So, this is going to be click-through of product lists,
is Number One, unknown terror of typing things by hand.
I think three is added to the cart,
I'm just going to copy these things verbatim.
Number 2 is viewed a product detail page, and again,
once you have these insights,
is these sample queries,
if you work with your own Google Analytics dataset,
you can go wild, you can see like what product detail pages are viewed the most,
but then, nobody checks out with those products,
so you could revise those product detail pages,
because they have a lower conversion rate.
So, if you're working with e-commerce,
porting the data into BigQuery is a great first step to even sharpen your Analytics jobs,
but really get some really cool insights.
Number 5 is they're in the checkout process.
Number 4 is, here we go, gigantic case statement.
They removed it from the cart.
So, I'm going to execute selected on this.
Now, here's the issue. I'm going to run it.