Again, I am facing some discrepancies between data in Google Analytics and BigQuery, this time for E-commerce Transactions for a specific product brand. The query that I am using is this one:
SELECT EXACT_COUNT_DISTINCT(hits.transaction.transactionId) AS trans
FROM [data]
WHERE hits.eCommerceAction.action_type = STRING(6)
AND hits.product.productBrand CONTAINS "product-brand-name"
For example, the number of transactions in GA is 7.200 and on GBQ is 4.700.
However, if I calculate the results without the filter above, this time they match both in GA and GBQ:
SELECT EXACT_COUNT_DISTINCT(hits.transaction.transactionId) AS trans
FROM [data]
WHERE hits.eCommerceAction.action_type = STRING(6)
What am I doing wrong in the first case?
答案 0 :(得分:0)
尝试以下查询。它可能会给你你寻求的答案:
SELECT
hits.product.productBrand
, COUNT(DISTINCT hits.transaction.transactionId, 10000) AS trans
FROM [data]
WHERE
hits.eCommerceAction.action_type = STRING(6)
AND
hits.product.productBrand CONTAINS "product-brand-name"
GROUP EACH BY hits.product.productBrand