I am importing google Analytics data into bigquery session_streaming table using Owox BI. I have a requirement to count returning visits count using this data but result is not matching. Business logic: If newVisits is null then its a returning visitor Date Range: 10th june 2018
Source : Google
Medium: CPC
BigQuery Result: 136 Returning Visits
GA Account: 95(TotalUsers-New Users)
SELECT
count(distinct clientId ) as returningvisits
FROM `test.Test.session_streaming_20180610` where trafficSource.medium ='cpc' and trafficSource.source ='google' and newVisits is null
Schema of session streaming table
user RECORD NULLABLE
user.id STRING NULLABLE
user.phone STRING NULLABLE
user.email STRING NULLABLE
clientId STRING NULLABLE
date STRING NULLABLE
sessionId STRING NULLABLE
visitNumber INTEGER NULLABLE
newVisits INTEGER NULLABLE
There are few more fields.
Could you please help me whats wrong with this query ?