BigQuery Integration
Vendo’s BigQuery integration streams your Shopify e-commerce data directly to Google BigQuery, giving you a powerful data warehouse for advanced analytics, custom reporting, and machine learning applications. Own your data and run unlimited SQL queries against your complete customer dataset.
Overview
The BigQuery integration provides:
- Raw Data Access: Complete, unsampled Shopify data in your BigQuery project
- Real-time Streaming: Client-side events streamed directly to BigQuery
- Historical Sync: Full backfill of orders, customers, products, and more
- SQL Analytics: Run complex queries for custom analysis
- Data Ownership: Your data in your Google Cloud project
Key Benefits
- No data sampling or limits
- Combine Shopify data with other sources
- Build custom dashboards and reports
- Power machine learning models
- Support data science workflows
Setup Instructions
Prerequisites
- A Google Cloud Platform (GCP) account
- A BigQuery project (or ability to create one)
- Admin access to your Shopify store
- The Vendo app installed on your Shopify store
Step 1: Create a BigQuery Project
If you don’t have a project:
- Go to Google Cloud ConsoleÂ
- Create a new project or select existing one
- Enable the BigQuery API
- Note your Project ID
Step 2: Create a Service Account
- In GCP Console, go to IAM & Admin > Service Accounts
- Click Create Service Account
- Name it “Vendo Integration”
- Grant these roles:
- BigQuery Data Editor
- BigQuery Job User
- Create a JSON key and download it
Step 3: Configure in Vendo
- Open the Vendo app in your Shopify admin
- Navigate to Integrations > BigQuery
- Enter your credentials:
- Project ID: Your GCP project ID
- Service Account JSON: Upload or paste the JSON key
- Vendo will automatically create the dataset and tables
Step 4: Verify Connection
- Click “Test Connection” in Vendo
- Check BigQuery for the new dataset
- Tables will be created automatically
Data Tables
Vendo creates and maintains these tables in your BigQuery dataset:
| Table Name | Description | Update Frequency |
|---|---|---|
orders | Complete order data | Real-time + backfill |
customers | Customer profiles | Every few hours |
products | Product catalog | Daily |
events | Client-side tracking events | Real-time streaming |
abandoned_checkouts | Abandoned cart data | Hourly |
fulfillments | Order fulfillment data | Real-time |
inventory_items | Inventory levels | Daily |
errors | Integration error logs | Real-time |
Table Schemas
Orders Table
The orders table contains complete order information:
| Column | Type | Description |
|---|---|---|
id | INTEGER | Shopify order ID |
order_number | STRING | Display order number |
email | STRING | Customer email |
created_at | TIMESTAMP | Order creation time |
updated_at | TIMESTAMP | Last update time |
financial_status | STRING | Payment status |
fulfillment_status | STRING | Fulfillment state |
currency | STRING | Currency code |
subtotal_price | FLOAT | Order subtotal |
total_price | FLOAT | Order total |
total_tax | FLOAT | Tax amount |
total_discounts | FLOAT | Discount amount |
total_shipping_price_set | FLOAT | Shipping cost |
billing_address | RECORD | Billing address details |
shipping_address | RECORD | Shipping address details |
line_items | REPEATED RECORD | Products in order |
customer | RECORD | Customer information |
discount_codes | STRING | Discount codes used |
discount_applications | REPEATED RECORD | Discount details |
payment_gateway_names | REPEATED STRING | Payment methods |
tags | STRING | Order tags |
note | STRING | Order notes |
custom_order_attributes | REPEATED RECORD | Custom attributes |
landing_site | STRING | Landing page URL |
referring_site | STRING | Referrer URL |
source_name | STRING | Order source |
app_id | INTEGER | Creating app ID |
app_name | STRING | Creating app name |
fulfillments | REPEATED RECORD | Fulfillment records |
refunds | REPEATED RECORD | Refund records |
test | BOOLEAN | Test order flag |
confirmed | BOOLEAN | Confirmation status |
extracted_at | TIMESTAMP | Sync timestamp |
is_deleted | BOOLEAN | Deletion flag |
Line Items Structure
Each line item in an order contains:
| Column | Type | Description |
|---|---|---|
id | INTEGER | Line item ID |
product_id | INTEGER | Product ID |
variant_id | INTEGER | Variant ID |
title | STRING | Product title |
variant_title | STRING | Variant title |
sku | STRING | SKU |
quantity | INTEGER | Quantity |
price | FLOAT | Unit price |
total_discount | FLOAT | Line discount |
vendor | STRING | Vendor name |
fulfillment_service | STRING | Fulfillment service |
fulfillment_status | STRING | Item fulfillment status |
gift_card | BOOLEAN | Is gift card |
taxable | BOOLEAN | Is taxable |
tax_lines | REPEATED RECORD | Tax details |
properties | REPEATED RECORD | Custom properties |
discount_allocations | REPEATED RECORD | Discount allocations |
Customers Table
| Column | Type | Description |
|---|---|---|
id | INTEGER | Shopify customer ID |
email | STRING | Customer email |
first_name | STRING | First name |
last_name | STRING | Last name |
phone | STRING | Phone number |
created_at | TIMESTAMP | Account creation |
updated_at | TIMESTAMP | Last update |
orders_count | INTEGER | Total orders |
total_spent | STRING | Lifetime spend |
verified_email | BOOLEAN | Email verified |
accepts_marketing | BOOLEAN | Marketing consent |
tax_exempt | BOOLEAN | Tax exemption |
tags | STRING | Customer tags |
note | STRING | Admin notes |
state | STRING | Marketing state |
addresses | REPEATED RECORD | Saved addresses |
default_address | RECORD | Default address |
email_marketing_consent | RECORD | Email consent details |
sms_marketing_consent | RECORD | SMS consent details |
last_order_id | INTEGER | Last order ID |
last_order_name | STRING | Last order number |
extracted_at | TIMESTAMP | Sync timestamp |
is_deleted | BOOLEAN | Deletion flag |
Events Table
Client-side events streamed to BigQuery:
| Column | Type | Description |
|---|---|---|
id | INTEGER | Event ID |
subject_id | INTEGER | Related entity ID |
subject_type | STRING | Entity type (Order, Customer, etc.) |
verb | STRING | Event action |
message | STRING | Event message |
description | STRING | Event description |
body | STRING | Event payload (JSON) |
path | STRING | URL path |
author | STRING | Event author |
arguments | REPEATED STRING | Event arguments |
created_at | TIMESTAMP | Event timestamp |
extracted_at | TIMESTAMP | Sync timestamp |
is_deleted | BOOLEAN | Deletion flag |
Abandoned Checkouts Table
| Column | Type | Description |
|---|---|---|
id | INTEGER | Checkout ID |
token | STRING | Checkout token |
email | STRING | Customer email |
created_at | TIMESTAMP | Checkout creation |
updated_at | TIMESTAMP | Last update |
completed_at | TIMESTAMP | Completion time (null if abandoned) |
abandoned_checkout_url | STRING | Recovery URL |
currency | STRING | Currency code |
subtotal_price | FLOAT | Cart subtotal |
total_price | FLOAT | Cart total |
total_tax | FLOAT | Tax amount |
total_discounts | FLOAT | Discounts applied |
billing_address | RECORD | Billing info |
shipping_address | RECORD | Shipping info |
line_items | REPEATED RECORD | Cart items |
discount_codes | STRING | Discount codes |
buyer_accepts_marketing | BOOLEAN | Marketing consent |
source_name | STRING | Source |
note_attributes | REPEATED RECORD | Custom attributes |
customer | RECORD | Customer details |
extracted_at | TIMESTAMP | Sync timestamp |
is_deleted | BOOLEAN | Deletion flag |
Fulfillments Structure (Nested in Orders)
| Column | Type | Description |
|---|---|---|
id | INTEGER | Fulfillment ID |
order_id | INTEGER | Parent order ID |
status | STRING | Fulfillment status |
shipment_status | STRING | Shipping status |
service | STRING | Fulfillment service |
tracking_company | STRING | Carrier name |
tracking_number | STRING | Tracking number |
tracking_url | STRING | Tracking URL |
tracking_numbers | REPEATED STRING | All tracking numbers |
tracking_urls | REPEATED STRING | All tracking URLs |
delivery_date | TIMESTAMP | Delivery confirmation |
created_at | TIMESTAMP | Fulfillment creation |
updated_at | TIMESTAMP | Last update |
line_items | REPEATED RECORD | Fulfilled items |
location_id | INTEGER | Origin location |
receipt | RECORD | Receipt details |
origin_address | RECORD | Ship-from address |
Refunds Structure (Nested in Orders)
| Column | Type | Description |
|---|---|---|
id | INTEGER | Refund ID |
order_id | INTEGER | Parent order ID |
created_at | TIMESTAMP | Refund creation |
processed_at | TIMESTAMP | Processing time |
refund_amount | FLOAT | Total refund amount |
note | STRING | Refund note |
restock | BOOLEAN | Items restocked |
refund_line_items | REPEATED RECORD | Refunded items |
transactions | REPEATED RECORD | Transaction details |
order_adjustments | REPEATED RECORD | Order adjustments |
Events Streamed
Client-Side Events
Events captured from customer browser sessions:
| Event Name | Description |
|---|---|
page_viewed | Page view |
product_viewed | Product page view |
collection_viewed | Collection page view |
search_submitted | Search performed |
product_added_to_cart | Add to cart |
product_removed_from_cart | Remove from cart |
cart_viewed | Cart page view |
checkout_started | Checkout initiated |
checkout_contact_info_submitted | Contact info entered |
checkout_address_info_submitted | Address entered |
checkout_shipping_info_submitted | Shipping selected |
payment_info_submitted | Payment info entered |
checkout_completed | Purchase completed |
Client-Side Event Schema
All client-side events are inserted into an events table with the following schema:
| Column | Type | Description |
|---|---|---|
event_name | STRING | Lowercase event name (e.g., “page_viewed”) |
event_timestamp | TIMESTAMP | When the event occurred |
user_id | STRING | Shopify Customer ID (null for anonymous) |
anonymous_id | STRING | Shopify device/client ID |
session_id | STRING | Browser session ID |
page_url | STRING | Full page URL |
page_title | STRING | Document title |
page_path | STRING | URL pathname |
referrer | STRING | Referring URL |
device_type | STRING | Device type (Desktop, Mobile, Tablet) |
browser | STRING | Browser name |
os | STRING | Operating system |
screen_width | INTEGER | Screen width in pixels |
screen_height | INTEGER | Screen height in pixels |
language | STRING | Browser language |
currency | STRING | Currency code |
value | FLOAT | Event value (cart total, product price, etc.) |
utm_source | STRING | UTM source parameter |
utm_medium | STRING | UTM medium parameter |
utm_campaign | STRING | UTM campaign parameter |
utm_content | STRING | UTM content parameter |
utm_term | STRING | UTM term parameter |
gclid | STRING | Google Click ID |
fbclid | STRING | Facebook Click ID |
msclkid | STRING | Microsoft Click ID |
ttclid | STRING | TikTok Click ID |
properties | STRING | Event-specific properties (JSON) |
products | STRING | Product array (JSON) |
source | STRING | Source identifier |
version | STRING | Tracking version |
insert_id | STRING | Unique event ID for deduplication |
Client-Side Event Payloads
Below are example payloads for each client-side event as inserted into BigQuery.
Page Viewed Event
{
"event_name": "page_viewed",
"event_timestamp": "2024-01-15T10:30:00.000Z",
"user_id": null,
"anonymous_id": "shop_client_abc123",
"session_id": "sess_xyz789",
"page_url": "https://mystore.com/collections/summer",
"page_title": "Summer Collection – My Store",
"page_path": "/collections/summer",
"referrer": "https://google.com",
"device_type": "Desktop",
"browser": "Chrome",
"os": "Mac OS X",
"screen_width": 1440,
"screen_height": 900,
"language": "en-US",
"currency": "USD",
"value": 0,
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "summer-sale",
"utm_content": null,
"utm_term": null,
"gclid": "CjwKCAjw...",
"fbclid": null,
"msclkid": null,
"ttclid": null,
"properties": "{}",
"products": null,
"source": "vendo_web_pixel",
"version": "1.0.0",
"insert_id": "49b71cd2-295b-476a-a345-0eb50bd13b57"
}Product Viewed Event
{
"event_name": "product_viewed",
"event_timestamp": "2024-01-15T10:32:00.000Z",
"user_id": null,
"anonymous_id": "shop_client_abc123",
"session_id": "sess_xyz789",
"page_url": "https://mystore.com/products/classic-tshirt",
"page_title": "Classic T-Shirt – My Store",
"page_path": "/products/classic-tshirt",
"referrer": "https://mystore.com/collections/all",
"device_type": "Desktop",
"browser": "Chrome",
"os": "Mac OS X",
"screen_width": 1440,
"screen_height": 900,
"language": "en-US",
"currency": "USD",
"value": 29.99,
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": null,
"properties": "{\"product_id\":\"gid://shopify/Product/7894561230\",\"product_title\":\"Classic T-Shirt\"}",
"products": "[{\"product_id\":\"gid://shopify/Product/7894561230\",\"sku\":\"TSHIRT-BLK-M\",\"name\":\"Classic T-Shirt\",\"price\":29.99,\"quantity\":1,\"variant_id\":\"gid://shopify/ProductVariant/42345678901\",\"variant_title\":\"Black / Medium\",\"brand\":\"My Brand\",\"category\":\"Apparel\"}]",
"source": "vendo_web_pixel",
"version": "1.0.0",
"insert_id": "prod-view-event-id-123"
}Product Added To Cart Event
{
"event_name": "product_added_to_cart",
"event_timestamp": "2024-01-15T10:35:00.000Z",
"user_id": null,
"anonymous_id": "shop_client_abc123",
"session_id": "sess_xyz789",
"page_url": "https://mystore.com/products/classic-tshirt",
"page_title": "Classic T-Shirt – My Store",
"page_path": "/products/classic-tshirt",
"referrer": null,
"device_type": "Desktop",
"browser": "Chrome",
"os": "Mac OS X",
"screen_width": 1440,
"screen_height": 900,
"language": "en-US",
"currency": "USD",
"value": 59.98,
"utm_source": "google",
"utm_medium": "cpc",
"properties": "{\"quantity\":2}",
"products": "[{\"product_id\":\"gid://shopify/Product/7894561230\",\"sku\":\"TSHIRT-BLK-M\",\"name\":\"Classic T-Shirt\",\"price\":29.99,\"quantity\":2,\"variant_id\":\"gid://shopify/ProductVariant/42345678901\",\"variant_title\":\"Black / Medium\",\"brand\":\"My Brand\",\"category\":\"Apparel\"}]",
"source": "vendo_web_pixel",
"version": "1.0.0",
"insert_id": "add-cart-event-id-456"
}Cart Viewed Event
{
"event_name": "cart_viewed",
"event_timestamp": "2024-01-15T10:38:00.000Z",
"user_id": null,
"anonymous_id": "shop_client_abc123",
"session_id": "sess_xyz789",
"page_url": "https://mystore.com/cart",
"page_title": "Your Cart – My Store",
"page_path": "/cart",
"device_type": "Desktop",
"browser": "Chrome",
"os": "Mac OS X",
"currency": "USD",
"value": 149.97,
"properties": "{\"quantity\":3}",
"products": "[{\"product_id\":\"gid://shopify/Product/7894561230\",\"name\":\"Classic T-Shirt\",\"price\":29.99,\"quantity\":2},{\"product_id\":\"gid://shopify/Product/7894561231\",\"name\":\"Running Shorts\",\"price\":45.00,\"quantity\":1}]",
"source": "vendo_web_pixel",
"version": "1.0.0",
"insert_id": "cart-view-event-id-789"
}Checkout Started Event
{
"event_name": "checkout_started",
"event_timestamp": "2024-01-15T10:40:00.000Z",
"user_id": null,
"anonymous_id": "shop_client_abc123",
"session_id": "sess_xyz789",
"page_url": "https://mystore.com/checkouts/abc123",
"page_title": "Checkout – My Store",
"page_path": "/checkouts/abc123",
"device_type": "Desktop",
"browser": "Chrome",
"os": "Mac OS X",
"currency": "USD",
"value": 162.49,
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "summer-sale",
"properties": "{\"checkout_token\":\"abc123def456\",\"order_id\":\"gid://shopify/Order/5363269534010\",\"cart_subtotal_amount\":149.97,\"tax_amount\":12.52,\"shipping_amount\":0}",
"products": "[{\"product_id\":\"gid://shopify/Product/7894561230\",\"name\":\"Classic T-Shirt\",\"price\":29.99,\"quantity\":2}]",
"source": "vendo_web_pixel",
"version": "1.0.0",
"insert_id": "checkout-started-id-101"
}Checkout Completed Event
{
"event_name": "checkout_completed",
"event_timestamp": "2024-01-15T10:45:00.000Z",
"user_id": "6359703453860",
"anonymous_id": "shop_client_abc123",
"session_id": "sess_xyz789",
"page_url": "https://mystore.com/checkouts/abc123/thank_you",
"page_title": "Thank you – My Store",
"page_path": "/checkouts/abc123/thank_you",
"device_type": "Desktop",
"browser": "Chrome",
"os": "Mac OS X",
"currency": "USD",
"value": 162.49,
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "summer-sale",
"gclid": "CjwKCAjw...",
"properties": "{\"checkout_token\":\"abc123def456\",\"order_id\":\"gid://shopify/Order/5363269534010\",\"cart_subtotal_amount\":149.97,\"tax_amount\":12.52,\"shipping_amount\":10.00,\"email\":\"customer@email.com\",\"phone\":\"+14155551234\"}",
"products": "[{\"product_id\":\"gid://shopify/Product/7894561230\",\"name\":\"Classic T-Shirt\",\"price\":29.99,\"quantity\":2}]",
"source": "vendo_web_pixel",
"version": "1.0.0",
"insert_id": "checkout-completed-id-202"
}Collection Viewed Event
{
"event_name": "collection_viewed",
"event_timestamp": "2024-01-15T10:28:00.000Z",
"user_id": null,
"anonymous_id": "shop_client_abc123",
"session_id": "sess_xyz789",
"page_url": "https://mystore.com/collections/summer",
"page_title": "Summer Collection – My Store",
"page_path": "/collections/summer",
"device_type": "Desktop",
"browser": "Chrome",
"os": "Mac OS X",
"currency": "USD",
"value": 0,
"properties": "{\"collection_id\":\"gid://shopify/Collection/123456789\",\"collection_title\":\"Summer Collection\"}",
"products": "[{\"product_id\":\"gid://shopify/Product/7894561230\",\"name\":\"Classic T-Shirt\",\"price\":29.99,\"quantity\":1},{\"product_id\":\"gid://shopify/Product/7894561231\",\"name\":\"Running Shorts\",\"price\":45.00,\"quantity\":1}]",
"source": "vendo_web_pixel",
"version": "1.0.0",
"insert_id": "collection-viewed-id-303"
}Search Submitted Event
{
"event_name": "search_submitted",
"event_timestamp": "2024-01-15T10:25:00.000Z",
"user_id": null,
"anonymous_id": "shop_client_abc123",
"session_id": "sess_xyz789",
"page_url": "https://mystore.com/search?q=t-shirt",
"page_title": "Search Results – My Store",
"page_path": "/search",
"device_type": "Desktop",
"browser": "Chrome",
"os": "Mac OS X",
"currency": "USD",
"value": 0,
"properties": "{\"search_query\":\"t-shirt\"}",
"products": "[{\"product_id\":\"gid://shopify/Product/7894561230\",\"name\":\"Classic T-Shirt\",\"price\":29.99,\"quantity\":1}]",
"source": "vendo_web_pixel",
"version": "1.0.0",
"insert_id": "search-submitted-id-404"
}Querying Client-Side Events
Example queries for client-side event data:
-- Page views by day
SELECT
DATE(event_timestamp) as date,
COUNT(*) as page_views,
COUNT(DISTINCT anonymous_id) as unique_visitors
FROM `your_project.your_dataset.events`
WHERE event_name = 'page_viewed'
GROUP BY date
ORDER BY date DESC
-- Product view to add-to-cart conversion
SELECT
DATE(pv.event_timestamp) as date,
COUNT(DISTINCT pv.insert_id) as product_views,
COUNT(DISTINCT atc.insert_id) as add_to_carts,
SAFE_DIVIDE(COUNT(DISTINCT atc.insert_id), COUNT(DISTINCT pv.insert_id)) * 100 as conversion_rate
FROM `your_project.your_dataset.events` pv
LEFT JOIN `your_project.your_dataset.events` atc
ON pv.anonymous_id = atc.anonymous_id
AND atc.event_name = 'product_added_to_cart'
AND DATE(atc.event_timestamp) = DATE(pv.event_timestamp)
WHERE pv.event_name = 'product_viewed'
GROUP BY date
ORDER BY date DESC
-- UTM attribution for completed checkouts
SELECT
utm_source,
utm_medium,
utm_campaign,
COUNT(*) as conversions,
SUM(value) as revenue
FROM `your_project.your_dataset.events`
WHERE event_name = 'checkout_completed'
AND event_timestamp >= DATE_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
GROUP BY utm_source, utm_medium, utm_campaign
ORDER BY revenue DESCUser Identification
Customer ID Mapping
| Source | BigQuery Column | Description |
|---|---|---|
| Shopify Customer ID | customer.id | Primary identifier |
customer.email / email | Email address | |
| Phone | customer.phone | Phone number |
Joining Data
Link events to orders:
-- Link events to orders by customer
SELECT
e.*,
o.order_number,
o.total_price
FROM events e
JOIN orders o ON e.subject_id = o.customer.id
WHERE e.subject_type = 'Customer'Example Queries
Revenue by Day
SELECT
DATE(created_at) as order_date,
COUNT(*) as orders,
SUM(total_price) as revenue,
AVG(total_price) as aov
FROM `your_project.your_dataset.orders`
WHERE financial_status = 'paid'
AND created_at >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
GROUP BY order_date
ORDER BY order_date DESCTop Products by Revenue
SELECT
li.product_id,
li.title as product_name,
COUNT(*) as times_ordered,
SUM(li.quantity) as units_sold,
SUM(li.price * li.quantity) as revenue
FROM `your_project.your_dataset.orders` o,
UNNEST(line_items) as li
WHERE o.financial_status = 'paid'
GROUP BY li.product_id, li.title
ORDER BY revenue DESC
LIMIT 20Customer Lifetime Value
SELECT
c.id as customer_id,
c.email,
c.first_name,
c.last_name,
COUNT(o.id) as order_count,
SUM(o.total_price) as lifetime_value,
MIN(o.created_at) as first_order,
MAX(o.created_at) as last_order,
DATE_DIFF(MAX(o.created_at), MIN(o.created_at), DAY) as customer_lifespan_days
FROM `your_project.your_dataset.customers` c
LEFT JOIN `your_project.your_dataset.orders` o ON c.id = o.customer.id
WHERE o.financial_status = 'paid'
GROUP BY c.id, c.email, c.first_name, c.last_name
ORDER BY lifetime_value DESCAbandoned Cart Analysis
SELECT
DATE(created_at) as date,
COUNT(*) as abandoned_carts,
SUM(total_price) as abandoned_value,
AVG(total_price) as avg_abandoned_value,
COUNT(DISTINCT email) as unique_customers
FROM `your_project.your_dataset.abandoned_checkouts`
WHERE completed_at IS NULL
AND created_at >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
GROUP BY date
ORDER BY date DESCFulfillment Speed Analysis
SELECT
DATE(o.created_at) as order_date,
COUNT(DISTINCT o.id) as orders,
AVG(DATE_DIFF(f.created_at, o.created_at, DAY)) as avg_fulfillment_days,
AVG(DATE_DIFF(f.delivery_date, f.created_at, DAY)) as avg_delivery_days
FROM `your_project.your_dataset.orders` o,
UNNEST(fulfillments) as f
WHERE f.delivery_date IS NOT NULL
GROUP BY order_date
ORDER BY order_date DESCCohort Analysis (First Purchase Month)
WITH customer_cohorts AS (
SELECT
customer.id as customer_id,
FORMAT_DATE('%Y-%m', MIN(created_at)) as cohort_month,
DATE_DIFF(created_at, MIN(created_at) OVER (PARTITION BY customer.id), MONTH) as months_since_first
FROM `your_project.your_dataset.orders`
WHERE financial_status = 'paid'
GROUP BY customer.id, created_at
)
SELECT
cohort_month,
months_since_first,
COUNT(DISTINCT customer_id) as customers,
COUNT(*) as orders
FROM customer_cohorts
GROUP BY cohort_month, months_since_first
ORDER BY cohort_month, months_since_firstDiscount Code Performance
SELECT
JSON_EXTRACT_SCALAR(d, '$.code') as discount_code,
JSON_EXTRACT_SCALAR(d, '$.type') as discount_type,
COUNT(*) as times_used,
SUM(total_price) as revenue_with_discount,
AVG(total_discounts) as avg_discount_amount
FROM `your_project.your_dataset.orders`,
UNNEST(JSON_EXTRACT_ARRAY(discount_codes)) as d
WHERE financial_status = 'paid'
GROUP BY discount_code, discount_type
ORDER BY times_used DESCTraffic Source Attribution
SELECT
REGEXP_EXTRACT(landing_site, r'utm_source=([^&]+)') as utm_source,
REGEXP_EXTRACT(landing_site, r'utm_medium=([^&]+)') as utm_medium,
REGEXP_EXTRACT(landing_site, r'utm_campaign=([^&]+)') as utm_campaign,
COUNT(*) as orders,
SUM(total_price) as revenue,
AVG(total_price) as aov
FROM `your_project.your_dataset.orders`
WHERE financial_status = 'paid'
AND landing_site IS NOT NULL
GROUP BY utm_source, utm_medium, utm_campaign
ORDER BY revenue DESCWhat to Expect in BigQuery
After Setup
- Dataset Created:
vendo_{shop_name}dataset appears - Tables Created: All schema tables are created
- Historical Backfill: Past data loads within hours
- Real-time Events: Client events stream immediately
Data Freshness
| Data Type | Latency |
|---|---|
| Client-side events | Real-time (seconds) |
| Orders | Near real-time (minutes) |
| Customers | Every few hours |
| Products | Daily |
| Abandoned carts | Hourly |
Storage Costs
BigQuery pricing:
- Storage: ~$0.02/GB/month
- Queries: ~$5/TB scanned (first 1TB free/month)
Estimated data volume (varies by store):
- Small store: < 1 GB/month
- Medium store: 1-10 GB/month
- Large store: 10-100 GB/month
Advanced Use Cases
1. Connect to BI Tools
Connect BigQuery to:
- Looker Studio (free): Direct BigQuery connector
- Tableau: BigQuery connector available
- Power BI: Google BigQuery connector
- Metabase: Built-in BigQuery support
2. Machine Learning
Use BigQuery ML for:
- Customer churn prediction
- Product recommendations
- Demand forecasting
- Customer segmentation
-- Example: Create a purchase prediction model
CREATE OR REPLACE MODEL `your_dataset.purchase_prediction`
OPTIONS(model_type='logistic_reg') AS
SELECT
IF(order_count > 0, 1, 0) as will_purchase,
page_views,
products_viewed,
cart_adds,
days_since_last_visit
FROM customer_behavior_features3. Data Warehouse Integration
Join with other data sources:
- Ad platform spend data
- CRM data
- Email marketing metrics
- Inventory systems
Troubleshooting
Data Not Appearing
- Check service account permissions: Must have BigQuery Data Editor
- Verify project ID: Ensure correct project ID configured
- Check dataset: Look for
vendo_*dataset in BigQuery
Query Errors
- Table not found: Check dataset and table names
- Permission denied: Verify IAM roles
- Quota exceeded: Check BigQuery quotas
Stale Data
- Check sync status: View integration status in Vendo
- Verify connection: Test connection in settings
- Review error logs: Check
errorstable for issues
Support
For assistance with your BigQuery integration:
- Email: support@vendodata.com
- Documentation: https://docs.vendodata.comÂ
- BigQuery Help: https://cloud.google.com/bigquery/docsÂ