In this talk, Areej will share her learning process, how SEOs can get acquainted with the world of BigQuery and why SQL is the new and improved Excel. The audience will walk away with a handful of scripts and tips to get their BigQuery journey started!
3. @areej_abuali
HELLO!
I’m here to talk to you about how (5
months ago) I started using was forced
to start using BigQuery & SQL in my
day to day job.
3
15. @areej_abuali
What is BigQuery?
15
“BigQuery is an enterprise data warehouse that
stores and queries massive datasets by
enabling super-fast SQL queries using the
processing power of Google’s infrastructure.”
16. @areej_abuali
What is BigQuery?
16
“BigQuery is an enterprise data warehouse that
stores and queries massive datasets by
enabling super-fast SQL queries using the
processing power of Google’s infrastructure.”
TOO MUCH
GIBBERISH!
17. @areej_abuali
So what is it then?
17
It’s a thing that will help you analyse
massive datasets quickly and easily
via SQL!
19. @areej_abuali
Why is it useful?
▸ It’s cloud-based (super scalable)
▸ Unlimited access to historical data
19
20. @areej_abuali
Why is it useful?
▸ It’s cloud-based (super scalable)
▸ Unlimited access to historical data
▸ It’s pay as you go (1TB = $5)
20
21. @areej_abuali
Why is it useful?
▸ It’s cloud-based (super scalable)
▸ Unlimited access to historical data
▸ It’s pay as you go (1TB = $5)
▸ Simple interface and setup
21
22. @areej_abuali
And as for SQL...
▸ It’s a language used for extracting and
analysing data stored in databases
22
23. @areej_abuali
And as for SQL...
▸ It’s a language used for extracting and
analysing data stored in databases
▸ It’s way faster than Excel because the data
you’re analysing is stored separately
23
24. @areej_abuali
And as for SQL...
▸ It’s a language used for extracting and
analysing data stored in databases
▸ It’s way faster than Excel because the data
you’re analysing is stored separately
▸ Your code is reusable
24
45. @areej_abuali
SQL Query - From
45
PROJECT ID DATASET TABLE
bigquery-public-data.google_analytics_sample.ga_sessions_20170801
46. @areej_abuali
SELECT
date as Date,
channelGrouping as Channel,
totals.visits as Visits,
totals.transactionRevenue as Revenue
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_20170801`
46
SQL Query - From
48. @areej_abuali
SQL Query - Where
▸ WHERE channelGrouping = ‘Organic Search’
▸ WHERE channelGrouping in (‘Organic Search’, ‘Direct’)
▸ WHERE channelGrouping = ‘Organic Search’ AND date =
‘20170701’
48
49. @areej_abuali
SELECT
date as Date,
channelGrouping as Channel,
totals.visits as Visits,
totals.transactionRevenue as Revenue
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_20170801`
WHERE channelGrouping = 'Organic Search'
49
SQL Query - Where
51. @areej_abuali
SELECT
date as Date,
channelGrouping as Channel,
totals.visits as Visits,
totals.transactionRevenue as Revenue
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_20170801`
WHERE channelGrouping = 'Organic Search'
ORDER BY totals.visits desc
51
SQL Query - Order By
53. @areej_abuali
SELECT
date as Date,
channelGrouping as Channel,
totals.visits as Visits,
totals.transactionRevenue as Revenue
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_20170801`
WHERE channelGrouping = 'Organic Search'
ORDER BY Revenue desc
LIMIT 100
53
SQL Query - Limit
54. @areej_abuali
#standardSQL
SELECT
date as Date,
channelGrouping as Channel,
totals.visits as Visits,
totals.transactionRevenue as Revenue
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_20170801`
WHERE channelGrouping = 'Organic Search'
ORDER BY Revenue desc
LIMIT 100
54
Standard vs
Legacy
58. @areej_abuali
Your typical process...
58
▸ Open GA
▸ Filter data in GA
▸ Export GA data
▸ Open Excel
▸ Clean data
▸ Filter data
▸ Sort data
Cry because everything
breaks and you get the
spinning wheel of death
62. @areej_abuali
SQL Query - Select
62
SELECT
date as Date,
channelGrouping as Channel,
sum(totals.visits) as Visits,
sum(totals.transactionRevenue) as Revenue
63. @areej_abuali
SQL Query - Group By
63
SELECT
date as Date,
channelGrouping as Channel,
sum(totals.visits) as Visits,
sum(totals.transactionRevenue) as Revenue
GROUP BY Date, Channel
Non-aggregated
columns should
be in Group By
64. @areej_abuali
SELECT
date as Date,
channelGrouping as Channel,
sum(totals.visits) as Visits,
sum(totals.transactionRevenue) as Revenue
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_20170801`
WHERE channelGrouping = 'Organic Search'
GROUP BY Date, Channel
ORDER BY Revenue desc
LIMIT 100
64
74. @areej_abuali
SELECT
a.channelGrouping as Channel,
sum(a.totals.visits) as Visits,
sum(b.totals.transactionRevenue) as Revenue
FROM `project-1234.analytics.ga_sessions` a
LEFT JOIN `project-1234.analytics.ga_transactions` b
ON (a.ga_session_id = b.ga_session_id)
WHERE a.channelGrouping = 'Organic Search'
74
85. @areej_abuali
85
BristolSEO (Jan 28th)
ReadingSEO (Feb 13th)
Hayden Roche - Technical SEO at Scale
Attend more advanced talks!
https://www.meetup.com/bristol-seo/
https://www.meetup.com/SEO-Meetup-Reading/
@HaydenRoche3
86. @areej_abuali
86
Read everything Dom writes!
@dom_woodman
▸ How to Use BigQuery for Large-Scale SEO
▸ Guide to Log Analysis with Big Query
https://moz.com/blog/how-to-bigquery-large-scale-seo
https://www.distilled.net/log-file-analysis/
87. @areej_abuali
Beautiful Dom Slide!
▸ How long does it take for a page to be discovered after
being published?
▸ Which pages have requests from Googlebot?
▸ What are the top non-canonical pages being crawled?
▸ What are the most crawled parameters?
▸ Which directories have the most 404 error codes?
▸ Which pages are crawled with and without parameters?
87
https://www.slideshare.net/DominicWoodman/a-guide-to-log-analysis-with-big-query
89. @areej_abuali
89
More great resources/courses
▸ Coursera - From Data to Insights with Google Cloud
▸ QwikLabs - BigQuery for Marketing Analysts
▸ Coding is for Losers - Learning BigQuery SQL
▸ OnCrawl - Why SEOs Should Ditch Excel & Learn SQL
▸ Book - Google BigQuery: The Definitive Guide
▸ Google - BigQuery Documentation
▸ Google - BigQuery Cookbook
90. @areej_abuali
A few final points...
90
Try out every random SQL query
you come across
(and create a library of saved queries)
91. @areej_abuali
A few final points...
91
Mash up different datasets
together
(it helps answer tons of questions)
92. @areej_abuali
A few final points...
92
Share cool things you learn with
the rest of us
(and don’t worry about that one idiot on
Twitter who labels it as ‘old news’)
93. @areej_abuali
A few final points...
93
It’s okay to feel overwhelmed learning
something new
(maybe in 5 months you’ll be giving a talk
about it too!)