I'm trying to write a query via Bigquery with Google Analytics data to find out the impact of the page speed on my site. There is a lot of research that talk about the impact of a slow site website on conversions and I'm hoping to run a similar type of analysis (for example).
Currently I have the below query, however it looks like hit.time increases with totals.pageviews. If I'm not mistaken, this must mean that the hits.time is registered as total time on a site and not necessarily the total time on a given page.
SELECT
ROUND(AVG(totals.pageviews),0) AS avg_page_views,
CASE
WHEN hits.time <= 1000 THEN '0 Second'
WHEN hits.time BETWEEN 1001 AND 2000 THEN '1 Second'
WHEN hits.time BETWEEN 2001 AND 3000 THEN '2 Second'
WHEN hits.time BETWEEN 3001 AND 4000 THEN '3 Second'
WHEN hits.time BETWEEN 4001 AND 5000 THEN '4 Second'
WHEN hits.time BETWEEN 5001 AND 6000 THEN '5 Second'
WHEN hits.time BETWEEN 6001 AND 7000 THEN '6 Second'
WHEN hits.time BETWEEN 7001 AND 8000 THEN '7 Second'
WHEN hits.time BETWEEN 8001 AND 9000 THEN '8 Second'
WHEN hits.time BETWEEN 9001 AND 10000 THEN '9 Second'
WHEN hits.time BETWEEN 10001 AND 10000 THEN '10 Second'
ELSE 'More than 10 Seconds'
END hits.time
FROM
[session.ga_sessions_20150501]
WHERE
hits.page.pagePath != ''
and totals.bounces IS NOT NULL
AND hits.hitnumber >= 1
AND hits.time > 0
AND hits.type = 'PAGE'
AND hits.page.pagePath LIKE '%/work/apps/business/%'
GROUP BY 1,2
ORDER BY 1
LIMIT 2000
;
Any thoughts on how to change this query to pull the speed per page so it can be graphed with something like conversions or bounce rate? I know this data exists in Google Analytics, however I can't find a good dimension to use for via the Bigquery API , or in Google Analytics for that matter.
Thanks in advance!
You are totally off here.
hits.time
means something else:
The number of milliseconds after the visitStartTime when this hit was registered. The first hit has a hits.time of 0.
So measures the time elapsed since visit start time, and not at all loading time. It's the request time when it was initiated, nothing that has to do with DOM.
AFAIK there is no metric to give you DOM load time.
Schema: