Then comes the
Collection
Logs
Google Analytics
SELECT
timestamp(utc_usec_to_month(createdAt)) month,
round(sum(totals.validNetRevenue)) net_revenue,
sum(totals.validOrders) orders,
FROM dwh.orders
WHERE createdAt >= utc_usec_to_year(current_date())
GROUP BY 1
ORDER BY 1 DESC
SELECT
device.browser browser,
sum(totals.visits) sessions,
sum(totals.pageviews) pageviews,
FROM (
table_date_range(
[luxola.com:luxola-analytics:50639087.ga_sessions_],
timestamp(date_add(utc_usec_to_week(current_date(), 0), -1, 'week')),
timestamp(utc_usec_to_week(current_date(), 0))
)
)
GROUP BY 1
ORDER BY 2 DESC
SELECT
timestamp(date_start) date,
sum(integer(impressions)) impressions,
sum(clicks) clicks,
round(sum(clicks) / sum(integer(impressions)), 4) ctr,
FROM [luxola.com:luxola-analytics:facebook.insights]
WHERE timestamp(date_start) >= date_add(current_date(), -1, 'week')
GROUP BY 1
ORDER BY 1 DESC