### Pixel Setup Guide for Custom Sales Platform Source: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview Details headless Pixel installation for attribution and customer journey tracking. This is essential for capturing visitor interactions and attributing them to marketing channels. ```APIDOC Pixel Setup Guide: Functionality: Track website visitor behavior and attribute conversions. Installation: Embed Triple Whale Pixel script on your website. Events: purchase: Description: Fired when a customer completes a purchase. Parameters: order_id: string (required) - The unique identifier for the order. total_amount: number (required) - The total value of the purchase. currency: string (required) - The currency of the purchase (e.g., 'USD'). customer_id: string (optional) - The unique identifier for the customer. attribution_data: object (optional) - Data related to the attribution source. Example: twq('track', 'purchase', { 'order_id': 'ORD123', 'total_amount': 150.75, 'currency': 'USD', 'customer_id': 'CUST456' }); NewSubscription: Description: Fired when a customer signs up for a new subscription. Parameters: subscription_id: string (required) - The unique identifier for the subscription. customer_id: string (required) - The unique identifier for the customer. amount: number (required) - The subscription amount. billing_interval: string (required) - The billing frequency (e.g., 'monthly'). Example: twq('track', 'NewSubscription', { 'subscription_id': 'SUB789', 'customer_id': 'CUST456', 'amount': 25.00, 'billing_interval': 'monthly' }); Dependencies: Requires a corresponding order record to be sent via API or native platform for attribution and journey stitching. ``` -------------------------------- ### Pixel Setup Guide for Custom Sales Platform Source: https://triplewhale.readme.io/reference/custom-sales-platform Details headless Pixel installation for attribution and customer journey tracking. This is essential for capturing visitor interactions and attributing them to marketing channels. ```APIDOC Pixel Setup Guide: Functionality: Track website visitor behavior and attribute conversions. Installation: Embed Triple Whale Pixel script on your website. Events: purchase: Description: Fired when a customer completes a purchase. Parameters: order_id: string (required) - The unique identifier for the order. total_amount: number (required) - The total value of the purchase. currency: string (required) - The currency of the purchase (e.g., 'USD'). customer_id: string (optional) - The unique identifier for the customer. attribution_data: object (optional) - Data related to the attribution source. Example: twq('track', 'purchase', { 'order_id': 'ORD123', 'total_amount': 150.75, 'currency': 'USD', 'customer_id': 'CUST456' }); NewSubscription: Description: Fired when a customer signs up for a new subscription. Parameters: subscription_id: string (required) - The unique identifier for the subscription. customer_id: string (required) - The unique identifier for the customer. amount: number (required) - The subscription amount. billing_interval: string (required) - The billing frequency (e.g., 'monthly'). Example: twq('track', 'NewSubscription', { 'subscription_id': 'SUB789', 'customer_id': 'CUST456', 'amount': 25.00, 'billing_interval': 'monthly' }); Dependencies: Requires a corresponding order record to be sent via API or native platform for attribution and journey stitching. ``` -------------------------------- ### Triple Whale Custom Sales Platform Setup Overview Source: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview This section details the Triple Whale Custom Sales Platform setup, covering data ingestion methods, the necessity of both API and Pixel for custom configurations, setup guides, and frequently asked questions. It addresses data synchronization, field consistency, and integration requirements. ```APIDOC Custom Sales Platform Setup Overview: How Triple Whale Ingests Data: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#how-triple-whale-ingests-data Why You Need Both API and Pixel for Custom Setup: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#why-you-need-both-api-and-pixel-for-custom-setup Setup Guides: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#setup-guides Frequently Asked Questions: Can I use just one (Pixel or Custom Sales Platform)?: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#q-can-i-use-just-one-pixel-or-custom-sales-platform Do API and Pixel data need to be sent in a specific order?: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#q-do-api-and-pixel-data-need-to-be-sent-in-a-specific-order Why do some fields look the same in Pixel and API payloads?: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#q-why-do-some-fields-look-the-same-in-pixel-and-api-payloads Why send product/order/subscription data in both Pixel and API?: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#q-why-send-productordersubscription-data-in-both-pixel-and-api Do I need to connect Meta Ads, Klaviyo, or other integrations?: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#q-do-i-need-to-connect-meta-ads-klaviyo-or-other-integrations Support & Resources: Sample Demo Site: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#sample-demo-site Documentation & Support: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#documentation--support ``` -------------------------------- ### Triple Whale API - Custom Sales Platform Setup Source: https://triplewhale.readme.io/reference/upload-ads-data-using-google-sheets This section details the setup process for custom sales platforms using the Triple Whale API, including API and pixel setup guides. ```APIDOC APIDOC: Custom Sales Platform Setup Overview: GET /reference/custom-sales-platform-setup-overview Description: Provides an overview of setting up a custom sales platform with Triple Whale. Parameters: - None specified in the provided text. Returns: - None specified in the provided text. API Setup Guide for Custom Sales Platform: GET /reference/api-setup-guide-for-custom-sales-platform Description: Guides users through the API setup for custom sales platforms. Parameters: - None specified in the provided text. Returns: - None specified in the provided text. Pixel Setup Guide for Custom Sales Platform: GET /reference/pixel-setup-guide-for-custom-sales-platform Description: Guides users through the pixel setup for custom sales platforms. Parameters: - None specified in the provided text. Returns: - None specified in the provided text. ``` -------------------------------- ### Verify Installation Source: https://triplewhale.readme.io/reference/pixel-setup-guide-for-custom-sales-platform Instructions on how to verify the Triple Whale pixel installation. A properly configured event should appear in the Network tab when triggered. Check the console for errors or inspect the page source if it does not. ```text A properly configured event will appear in the Network tab when triggered. If not, check the console for errors or inspect the page source to verify the implementation. Contact the TW SE team for further support: support@triplewhale.com ``` -------------------------------- ### Triple Whale Pixel Installation and Support Resources Source: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview This section provides direct links to Triple Whale's pixel installation settings and a comprehensive knowledge base covering various e-commerce platforms and custom event tracking. It also includes contact information for direct support. ```APIDOC Pixel Install Settings: URL: https://app.triplewhale.com/attribution/settings/installation Knowledge Base: Landing Pages: https://kb.triplewhale.com/en/articles/6269411-adding-the-triple-pixel-to-third-party-landing-pages Headless Stores: https://kb.triplewhale.com/en/articles/6266255-adding-the-triple-pixel-to-a-headless-store-or-custom-website Checkout: https://kb.triplewhale.com/en/articles/6610178-adding-the-triple-pixel-to-third-party-checkouts Custom Events: https://kb.triplewhale.com/en/articles/9957947-tracking-custom-events-with-triple-pixel-attribution Contact Support: Email: support@triplewhale.com ``` -------------------------------- ### Triple Whale Data Warehouse Sync Setup Source: https://triplewhale.readme.io/reference/creating-and-managing-triple-whale-api-keys Guides for setting up synchronization with various data warehouses, including BigQuery, Snowflake, AWS S3, and Google Cloud Storage. ```APIDOC APIDOC: /reference/sync-to-warehouse description: General information about Data Warehouse Sync. /reference/bigquery-setup-and-configuration description: Setup and configuration guide for BigQuery. /reference/snowflake-setup-and-configuration description: Setup and configuration guide for Snowflake. /reference/aws-s3-setup-and-configuration description: Setup and configuration guide for AWS S3. /reference/google-cloud-storage-setup-and-configuration description: Setup and configuration guide for Google Cloud Storage. /reference/de-duplication-for-data-warehouse-sync description: Information on de-duplication for Data Warehouse Sync. ``` -------------------------------- ### API Setup Guide for Custom Sales Platform Source: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview Provides backend API connection details for source-of-truth orders, products, and subscriptions data. This is crucial for businesses not using natively supported sales platforms. ```APIDOC API Setup Guide: Endpoint: /api/setup/custom-sales-platform Method: POST Description: Submit orders, products, and subscription data to Triple Whale. Authentication: API Key Request Body: orders: Array of order objects - order_id: string (required) - customer_id: string (optional) - order_date: datetime (required) - total_amount: number (required) - currency: string (required) - products: Array of product objects (optional) - sku: string (required) - quantity: integer (required) - price: number (required) products: Array of product objects (optional) - sku: string (required) - name: string (required) - category: string (optional) subscriptions: Array of subscription objects (optional) - subscription_id: string (required) - customer_id: string (required) - start_date: datetime (required) - status: string (required - e.g., 'active', 'canceled') - amount: number (required) - billing_interval: string (required - e.g., 'monthly', 'yearly') Responses: 200 OK: Successfully processed data. 400 Bad Request: Invalid data format. 401 Unauthorized: Missing or invalid API Key. Example: POST /api/setup/custom-sales-platform { "orders": [ { "order_id": "ORD123", "order_date": "2023-10-27T10:00:00Z", "total_amount": 150.75, "currency": "USD", "products": [ { "sku": "PROD001", "quantity": 2, "price": 50.00 } ] } ] } ``` -------------------------------- ### SQL Example Library Overview Source: https://triplewhale.readme.io/docs/sql-example-library-overview-and-best-practices Overview of the SQL Example Library for Triple Whale, providing working SQL queries for the Triple Whale data model. It emphasizes best practices for performance, readability, and correctness to assist advanced SQL users in building dashboards, reports, and agents efficiently. ```SQL /* SQL Example Library Overview The SQL Example Library contains working examples of SQL queries built for the Triple Whale data model. Each query solves a specific analytical problem and follows best practices for performance, readability, and correctness. The goal is to help advanced SQL users build dashboards, reports, and agents more efficiently using trusted patterns. Each example includes a complete working query, a breakdown of the tables and metrics involved, and customization tips for adapting the pattern to your specific use case. All examples are written for the Triple Whale's ClickHouse-driven SQL Editor. */ -- Example Query Structure: -- SELECT -- column1, -- column2 -- FROM -- your_table -- WHERE -- condition; -- For specific examples, please refer to the individual query documentation within the library. ``` -------------------------------- ### Triple Whale Custom Sales Platform Setup Overview Source: https://triplewhale.readme.io/reference/custom-sales-platform This section details the Triple Whale Custom Sales Platform setup, covering data ingestion methods, the necessity of both API and Pixel for custom configurations, setup guides, and frequently asked questions. It addresses data synchronization, field consistency, and integration requirements. ```APIDOC Custom Sales Platform Setup Overview: How Triple Whale Ingests Data: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#how-triple-whale-ingests-data Why You Need Both API and Pixel for Custom Setup: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#why-you-need-both-api-and-pixel-for-custom-setup Setup Guides: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#setup-guides Frequently Asked Questions: Can I use just one (Pixel or Custom Sales Platform)?: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#q-can-i-use-just-one-pixel-or-custom-sales-platform Do API and Pixel data need to be sent in a specific order?: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#q-do-api-and-pixel-data-need-to-be-sent-in-a-specific-order Why do some fields look the same in Pixel and API payloads?: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#q-why-do-some-fields-look-the-same-in-pixel-and-api-payloads Why send product/order/subscription data in both Pixel and API?: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#q-why-send-productordersubscription-data-in-both-pixel-and-api Do I need to connect Meta Ads, Klaviyo, or other integrations?: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#q-do-i-need-to-connect-meta-ads-klaviyo-or-other-integrations Support & Resources: Sample Demo Site: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#sample-demo-site Documentation & Support: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview#documentation--support ``` -------------------------------- ### Triple Whale Pixel Installation and Support Resources Source: https://triplewhale.readme.io/reference/custom-sales-platform This section provides direct links to Triple Whale's pixel installation settings and a comprehensive knowledge base covering various e-commerce platforms and custom event tracking. It also includes contact information for direct support. ```APIDOC Pixel Install Settings: URL: https://app.triplewhale.com/attribution/settings/installation Knowledge Base: Landing Pages: https://kb.triplewhale.com/en/articles/6269411-adding-the-triple-pixel-to-third-party-landing-pages Headless Stores: https://kb.triplewhale.com/en/articles/6266255-adding-the-triple-pixel-to-a-headless-store-or-custom-website Checkout: https://kb.triplewhale.com/en/articles/6610178-adding-the-triple-pixel-to-third-party-checkouts Custom Events: https://kb.triplewhale.com/en/articles/9957947-tracking-custom-events-with-triple-pixel-attribution Contact Support: Email: support@triplewhale.com ``` -------------------------------- ### Triple Whale Data Warehouse Sync Setup Source: https://triplewhale.readme.io/reference/api-keys Guides for setting up synchronization with various data warehouses, including BigQuery, Snowflake, AWS S3, and Google Cloud Storage. ```APIDOC APIDOC: /reference/sync-to-warehouse description: General information about Data Warehouse Sync. /reference/bigquery-setup-and-configuration description: Setup and configuration guide for BigQuery. /reference/snowflake-setup-and-configuration description: Setup and configuration guide for Snowflake. /reference/aws-s3-setup-and-configuration description: Setup and configuration guide for AWS S3. /reference/google-cloud-storage-setup-and-configuration description: Setup and configuration guide for Google Cloud Storage. /reference/de-duplication-for-data-warehouse-sync description: Information on de-duplication for Data Warehouse Sync. ``` -------------------------------- ### Triple Whale API - Data Warehouse Sync Setup Source: https://triplewhale.readme.io/reference/sync-to-warehouse Guides and configurations for setting up data synchronization to various data warehouses, including BigQuery, Snowflake, and AWS S3, as well as Google Cloud Storage. ```APIDOC BigQuery Setup and Configuration: Description: Instructions for configuring BigQuery for data warehouse sync. Link: /reference/bigquery-setup-and-configuration Snowflake Setup and Configuration: Description: Instructions for configuring Snowflake for data warehouse sync. Link: /reference/snowflake-setup-and-configuration AWS S3 Setup and Configuration: Description: Instructions for configuring AWS S3 for data warehouse sync. Link: /reference/aws-s3-setup-and-configuration Google Cloud Storage Setup and Configuration: Description: Instructions for configuring Google Cloud Storage for data warehouse sync. Link: /reference/google-cloud-storage-setup-and-configuration De-duplication for Data Warehouse Sync: Description: Information on handling de-duplication during data warehouse sync. Link: /reference/de-duplication-for-data-warehouse-sync ``` -------------------------------- ### SQL Example Library Overview Source: https://triplewhale.readme.io/docs/sql-example-library Overview of the SQL Example Library for Triple Whale, providing working SQL queries for the Triple Whale data model. It emphasizes best practices for performance, readability, and correctness to assist advanced SQL users in building dashboards, reports, and agents efficiently. ```SQL /* SQL Example Library Overview The SQL Example Library contains working examples of SQL queries built for the Triple Whale data model. Each query solves a specific analytical problem and follows best practices for performance, readability, and correctness. The goal is to help advanced SQL users build dashboards, reports, and agents more efficiently using trusted patterns. Each example includes a complete working query, a breakdown of the tables and metrics involved, and customization tips for adapting the pattern to your specific use case. All examples are written for the Triple Whale's ClickHouse-driven SQL Editor. */ -- Example Query Structure: -- SELECT -- column1, -- column2 -- FROM -- your_table -- WHERE -- condition; -- For specific examples, please refer to the individual query documentation within the library. ``` -------------------------------- ### SQL Example: Multi-Touch Landing Page Paths Source: https://triplewhale.readme.io/docs/why-does-my-total-revenue-across-channels-look-higher-than-my-store-revenue Provides an SQL example demonstrating how to analyze multi-touch landing page paths, including conversion and bounce metrics. This snippet is useful for understanding user journeys and campaign effectiveness. ```SQL SELECT landing_page, COUNT(DISTINCT user_id) AS unique_users, SUM(CASE WHEN conversion = TRUE THEN 1 ELSE 0 END) AS total_conversions, SUM(CASE WHEN bounce = TRUE THEN 1 ELSE 0 END) AS total_bounces, (SUM(CASE WHEN conversion = TRUE THEN 1 ELSE 0 END) * 1.0 / COUNT(DISTINCT user_id)) AS conversion_rate, (SUM(CASE WHEN bounce = TRUE THEN 1 ELSE 0 END) * 1.0 / COUNT(DISTINCT user_id)) AS bounce_rate FROM user_sessions GROUP BY landing_page ORDER BY conversion_rate DESC; ``` -------------------------------- ### SQL Example: Multi-Touch Landing Page Paths Source: https://triplewhale.readme.io/docs/data-troubleshooting Provides an SQL example demonstrating how to analyze multi-touch landing page paths, including conversion and bounce metrics. This snippet is useful for understanding user journeys and campaign effectiveness. ```SQL SELECT landing_page, COUNT(DISTINCT user_id) AS unique_users, SUM(CASE WHEN conversion = TRUE THEN 1 ELSE 0 END) AS total_conversions, SUM(CASE WHEN bounce = TRUE THEN 1 ELSE 0 END) AS total_bounces, (SUM(CASE WHEN conversion = TRUE THEN 1 ELSE 0 END) * 1.0 / COUNT(DISTINCT user_id)) AS conversion_rate, (SUM(CASE WHEN bounce = TRUE THEN 1 ELSE 0 END) * 1.0 / COUNT(DISTINCT user_id)) AS bounce_rate FROM user_sessions GROUP BY landing_page ORDER BY conversion_rate DESC; ``` -------------------------------- ### Triple Whale API Development Tips Source: https://triplewhale.readme.io/reference/api-setup-guide-for-custom-sales-platform Key recommendations for developers using the Triple Whale API. These tips focus on logging, validation, environment testing, and API key management to ensure robust and secure integrations. ```APIDOC Dev Tips: - Log all POST responses, including `order_id`, `response`, and `status`. - Validate all payloads against the required fields for each endpoint. - Test your integration on a **staging environment** first before pushing live. - Use separate API keys for **Testing** and **Production** to prevent cross-environment issues. ``` -------------------------------- ### SQL Examples: Product Purchase Patterns Source: https://triplewhale.readme.io/docs/sql-example-library-overview-and-best-practices Offers SQL queries to analyze product purchase sequences and identify popular first products, common next purchases, and the most frequently bought second products. ```SQL SELECT product_id, COUNT(*) AS first_purchase_count, AVG(order_total) AS average_order_value, SUM(order_total) AS lifetime_value FROM orders_table WHERE is_first_purchase = TRUE GROUP BY product_id ORDER BY first_purchase_count DESC; ``` ```SQL WITH RankedOrders AS ( SELECT customer_id, product_id, order_date, ROW_NUMBER() OVER(PARTITION BY customer_id ORDER BY order_date) as rn FROM orders_table ) SELECT ro1.product_id AS previous_product, ro2.product_id AS next_product, COUNT(*) AS purchase_sequence_count FROM RankedOrders ro1 JOIN RankedOrders ro2 ON ro1.customer_id = ro2.customer_id AND ro1.rn + 1 = ro2.rn GROUP BY ro1.product_id, ro2.product_id ORDER BY purchase_sequence_count DESC; ``` ```SQL WITH CustomerOrderSequence AS ( SELECT customer_id, product_id, order_date, LAG(product_id, 1) OVER (PARTITION BY customer_id ORDER BY order_date) AS previous_product_id FROM orders_table ) SELECT previous_product_id, product_id AS second_product_id, COUNT(*) AS count FROM CustomerOrderSequence WHERE previous_product_id IS NOT NULL GROUP BY previous_product_id, product_id ORDER BY count DESC; ``` -------------------------------- ### Triple Whale Data Troubleshooting Guides Source: https://triplewhale.readme.io/docs/sql-example-most-common-next-product-bought-sequential-product-purchases Addresses common questions and discrepancies regarding Triple Whale data, comparing it with other platforms like Shopify, Amazon, and Klaviyo. ```APIDOC TripleWhaleDataDiscrepancies: - Why Total Revenue Across Channels Higher Than Store Revenue? - Explanation: Differences may arise from attribution models, refund handling, and currency conversions. - Action: Review attribution settings and refund policies in both Triple Whale and your store platform. - Why Total Sales in Shopify Not Match Total Sales in Triple Whale? - Explanation: Discrepancies can be due to order processing times, unfulfilled orders, or different definitions of 'sale' (e.g., including/excluding tax, shipping). - Action: Ensure consistent definitions and check for any delays in data synchronization. - Why Amazon Product Sales in Triple Whale Different From Amazon’s Official Dashboard? - Explanation: Differences may stem from Amazon's reporting delays, different sales event categorizations (e.g., FBA vs. FBM), or specific attribution rules. - Action: Cross-reference sales reports for the same period and understand Amazon's reporting nuances. - Why New vs. Returning Customer Count Different in Triple Whale vs. Shopify? - Explanation: Customer identification methods can vary. Triple Whale might use a broader definition based on site interactions, while Shopify relies on account creation or purchase history. - Action: Analyze how each platform identifies and segments customers. - Why Klaviyo (or Email/SMS) Revenue in Triple Whale Different from Klaviyo Dashboard? - Explanation: Attribution models, campaign tagging, and the timing of revenue recognition can cause differences. Triple Whale may attribute revenue based on multi-touch attribution, while Klaviyo might use last-touch. - Action: Compare attribution models and ensure consistent UTM tagging for campaigns. ``` -------------------------------- ### Triple Whale Data Warehouse Sync Supported Warehouses Source: https://triplewhale.readme.io/reference/sync-to-warehouse Lists the data warehouses supported by Triple Whale's Data Warehouse Sync feature, with links to setup guides for each. ```APIDOC Supported Warehouses: - BigQuery: [Learn how to set up BigQuery](https://triplewhale.readme.io/reference/bigquery-setup-and-configuration) - Snowflake: [Learn how to set up Snowflake](https://triplewhale.readme.io/reference/snowflake-setup-and-configuration) - AWS S3: [Learn how to set up AWS S3](https://triplewhale.readme.io/reference/aws-s3-setup-and-configuration) - Google Cloud Storage: [Learn how to set up GCS](https://triplewhale.readme.io/reference/google-cloud-storage-setup-and-configuration#) ``` -------------------------------- ### SQL Examples: Product Purchase Patterns Source: https://triplewhale.readme.io/docs/sql-example-website-performance-by-device-and-country Offers SQL queries to analyze product purchase sequences and identify popular first products, common next purchases, and the most frequently bought second products. ```SQL SELECT product_id, COUNT(*) AS first_purchase_count, AVG(order_total) AS average_order_value, SUM(order_total) AS lifetime_value FROM orders_table WHERE is_first_purchase = TRUE GROUP BY product_id ORDER BY first_purchase_count DESC; ``` ```SQL WITH RankedOrders AS ( SELECT customer_id, product_id, order_date, ROW_NUMBER() OVER(PARTITION BY customer_id ORDER BY order_date) as rn FROM orders_table ) SELECT ro1.product_id AS previous_product, ro2.product_id AS next_product, COUNT(*) AS purchase_sequence_count FROM RankedOrders ro1 JOIN RankedOrders ro2 ON ro1.customer_id = ro2.customer_id AND ro1.rn + 1 = ro2.rn GROUP BY ro1.product_id, ro2.product_id ORDER BY purchase_sequence_count DESC; ``` ```SQL WITH CustomerOrderSequence AS ( SELECT customer_id, product_id, order_date, LAG(product_id, 1) OVER (PARTITION BY customer_id ORDER BY order_date) AS previous_product_id FROM orders_table ) SELECT previous_product_id, product_id AS second_product_id, COUNT(*) AS count FROM CustomerOrderSequence WHERE previous_product_id IS NOT NULL GROUP BY previous_product_id, product_id ORDER BY count DESC; ``` -------------------------------- ### Triple Whale Pixel Demo Site Source: https://triplewhale.readme.io/reference/custom-sales-platform-setup-overview Information about a sample demo site showcasing the Triple Whale Pixel in action, including links to its source code and live website. ```HTML Source Code: Live Website: ``` -------------------------------- ### API Setup Guide for Custom Sales Platform Source: https://triplewhale.readme.io/reference/custom-sales-platform Provides backend API connection details for source-of-truth orders, products, and subscriptions data. This is crucial for businesses not using natively supported sales platforms. ```APIDOC API Setup Guide: Endpoint: /api/setup/custom-sales-platform Method: POST Description: Submit orders, products, and subscription data to Triple Whale. Authentication: API Key Request Body: orders: Array of order objects - order_id: string (required) - customer_id: string (optional) - order_date: datetime (required) - total_amount: number (required) - currency: string (required) - products: Array of product objects (optional) - sku: string (required) - quantity: integer (required) - price: number (required) products: Array of product objects (optional) - sku: string (required) - name: string (required) - category: string (optional) subscriptions: Array of subscription objects (optional) - subscription_id: string (required) - customer_id: string (required) - start_date: datetime (required) - status: string (required - e.g., 'active', 'canceled') - amount: number (required) - billing_interval: string (required - e.g., 'monthly', 'yearly') Responses: 200 OK: Successfully processed data. 400 Bad Request: Invalid data format. 401 Unauthorized: Missing or invalid API Key. Example: POST /api/setup/custom-sales-platform { "orders": [ { "order_id": "ORD123", "order_date": "2023-10-27T10:00:00Z", "total_amount": 150.75, "currency": "USD", "products": [ { "sku": "PROD001", "quantity": 2, "price": 50.00 } ] } ] } ``` -------------------------------- ### Triple Whale API - Data Warehouse Sync Source: https://triplewhale.readme.io/reference/aws-s3-setup-and-configuration Documentation for syncing data to various data warehouses, including setup and configuration guides for BigQuery, Snowflake, and AWS S3, as well as de-duplication strategies. ```APIDOC Data Warehouse Sync: BigQuery Setup and Configuration - Reference: /reference/bigquery-setup-and-configuration Snowflake Setup and Configuration - Reference: /reference/snowflake-setup-and-configuration AWS S3 Setup and Configuration - Reference: /reference/aws-s3-setup-and-configuration - Details: Guides on bucket and permissions setup for syncing data to AWS S3. Google Cloud Storage Setup and Configuration - Reference: /reference/google-cloud-storage-setup-and-configuration De-duplication for Data Warehouse Sync - Reference: /reference/de-duplication-for-data-warehouse-sync ``` -------------------------------- ### SQL Examples: Product Purchase Patterns Source: https://triplewhale.readme.io/docs/sql-example-hourly-revenue-indexed-by-day Offers SQL queries to analyze product purchase sequences and identify popular first products, common next purchases, and the most frequently bought second products. ```SQL SELECT product_id, COUNT(*) AS first_purchase_count, AVG(order_total) AS average_order_value, SUM(order_total) AS lifetime_value FROM orders_table WHERE is_first_purchase = TRUE GROUP BY product_id ORDER BY first_purchase_count DESC; ``` ```SQL WITH RankedOrders AS ( SELECT customer_id, product_id, order_date, ROW_NUMBER() OVER(PARTITION BY customer_id ORDER BY order_date) as rn FROM orders_table ) SELECT ro1.product_id AS previous_product, ro2.product_id AS next_product, COUNT(*) AS purchase_sequence_count FROM RankedOrders ro1 JOIN RankedOrders ro2 ON ro1.customer_id = ro2.customer_id AND ro1.rn + 1 = ro2.rn GROUP BY ro1.product_id, ro2.product_id ORDER BY purchase_sequence_count DESC; ``` ```SQL WITH CustomerOrderSequence AS ( SELECT customer_id, product_id, order_date, LAG(product_id, 1) OVER (PARTITION BY customer_id ORDER BY order_date) AS previous_product_id FROM orders_table ) SELECT previous_product_id, product_id AS second_product_id, COUNT(*) AS count FROM CustomerOrderSequence WHERE previous_product_id IS NOT NULL GROUP BY previous_product_id, product_id ORDER BY count DESC; ``` -------------------------------- ### Triple Whale API Reference Source: https://triplewhale.readme.io/index Provides an overview of the Triple Whale API, including how to get started, manage API keys, and utilize data ingestion capabilities. It also links to further documentation on data warehouse synchronization. ```APIDOC Triple Whale API: Introduction: https://triplewhale.readme.io/reference/introduction-to-the-triple-whale-api API Keys: https://triplewhale.readme.io/reference/api-keys Data In (BETA): https://triplewhale.readme.io/reference/data-in Sync to Data Warehouse: https://triplewhale.readme.io/reference/sync-to-warehouse BigQuery Setup and Configuration: https://triplewhale.readme.io/reference/bigquery-setup-and-configuration Snowflake Setup and Configuration: https://triplewhale.readme.io/reference/snowflake-setup-and-configuration ``` -------------------------------- ### Triple Whale API - Data Warehouse Sync Setup Source: https://triplewhale.readme.io/reference/de-duplication-for-data-warehouse-sync Guides for setting up data synchronization to various data warehouses, including BigQuery, Snowflake, AWS S3, and Google Cloud Storage. Also covers de-duplication strategies for ensuring data integrity. ```APIDOC BigQuery Setup and Configuration Description: Guide for configuring data sync with BigQuery. Snowflake Setup and Configuration Description: Guide for configuring data sync with Snowflake. AWS S3 Setup and Configuration Description: Guide for configuring data sync with AWS S3. Google Cloud Storage Setup and Configuration Description: Guide for configuring data sync with Google Cloud Storage. De-duplication for Data Warehouse Sync Description: Explains how to handle de-duplication for data warehouse sync to ensure accurate querying of the most recent data versions. ``` -------------------------------- ### Triple Whale API Reference - Data Ingest Source: https://triplewhale.readme.io/reference/enrich-orders-data This section details the API endpoints for ingesting data into Triple Whale, including creating records for orders, products, subscriptions, and ads. It also covers setup guides for custom sales platforms and third-party integrations. ```APIDOC APIDOC: Create Order Record: POST /reference/create-order-record Description: Creates a new order record in Triple Whale. Parameters: - (Required) order_data: Object containing order details. Returns: - Success message or order ID. Create Product Record: POST /reference/create-product-record Description: Creates a new product record in Triple Whale. Parameters: - (Required) product_data: Object containing product details. Returns: - Success message or product ID. Create Subscription Record: POST /reference/create-subscription-record Description: Creates a new subscription record in Triple Whale. Parameters: - (Required) subscription_data: Object containing subscription details. Returns: - Success message or subscription ID. Create Ad Record: POST /reference/create-ad-record Description: Creates a new ad record in Triple Whale. Parameters: - (Required) ad_data: Object containing ad details. Returns: - Success message or ad ID. Create Post-Purchase Survey (PPS) Record: POST /reference/create-pps-record Description: Creates a new post-purchase survey record in Triple Whale. Parameters: - (Required) pps_data: Object containing PPS details. Returns: - Success message or PPS record ID. ``` -------------------------------- ### Triple Whale API Reference - Data Ingest Source: https://triplewhale.readme.io/reference/data-enrichment-for-native-sales-platforms This section details the API endpoints for ingesting data into Triple Whale, including creating records for orders, products, subscriptions, and ads. It also covers setup guides for custom sales platforms and third-party integrations. ```APIDOC APIDOC: Create Order Record: POST /reference/create-order-record Description: Creates a new order record in Triple Whale. Parameters: - (Required) order_data: Object containing order details. Returns: - Success message or order ID. Create Product Record: POST /reference/create-product-record Description: Creates a new product record in Triple Whale. Parameters: - (Required) product_data: Object containing product details. Returns: - Success message or product ID. Create Subscription Record: POST /reference/create-subscription-record Description: Creates a new subscription record in Triple Whale. Parameters: - (Required) subscription_data: Object containing subscription details. Returns: - Success message or subscription ID. Create Ad Record: POST /reference/create-ad-record Description: Creates a new ad record in Triple Whale. Parameters: - (Required) ad_data: Object containing ad details. Returns: - Success message or ad ID. Create Post-Purchase Survey (PPS) Record: POST /reference/create-pps-record Description: Creates a new post-purchase survey record in Triple Whale. Parameters: - (Required) pps_data: Object containing PPS details. Returns: - Success message or PPS record ID. ``` -------------------------------- ### Triple Whale Data Schema and Metrics Source: https://triplewhale.readme.io/index Details the structure of Triple Whale data, including various tables like Blended Stats and Pixel Keywords, and outlines available metrics such as Custom, Store, and Ad Metrics. It also provides links to data usage guides and SQL examples. ```APIDOC Triple Whale Data Schema: Blended Stats Table: https://triplewhale.readme.io/docs/blended-stats-table Pixel Joined Table: https://triplewhale.readme.io/docs/pixel-joined-table Pixel Keywords Joined Table: https://triplewhale.readme.io/docs/pixel-keywords-joined-table Triple Whale Metrics: Custom Metrics: https://triplewhale.readme.io/docs/custom-metrics Store Metrics: https://triplewhale.readme.io/docs/store-metrics Ad Metrics: https://triplewhale.readme.io/docs/ad-metrics Using Triple Whale Data: Data in Triple Whale: https://triplewhale.readme.io/docs/data-in-triple-whale SQL Example Library: https://triplewhale.readme.io/docs/sql-example-library Data Troubleshooting Guides: https://triplewhale.readme.io/docs/data-troubleshooting ``` -------------------------------- ### Triple Whale Data Troubleshooting Guides Source: https://triplewhale.readme.io/docs/sql-example-multi-touch-landing-page-paths-conversion-bounce-metrics Addresses common questions and discrepancies regarding Triple Whale data, comparing it with other platforms like Shopify, Amazon, and Klaviyo. ```APIDOC TripleWhaleDataDiscrepancies: - Why Total Revenue Across Channels Higher Than Store Revenue? - Explanation: Differences may arise from attribution models, refund handling, and currency conversions. - Action: Review attribution settings and refund policies in both Triple Whale and your store platform. - Why Total Sales in Shopify Not Match Total Sales in Triple Whale? - Explanation: Discrepancies can be due to order processing times, unfulfilled orders, or different definitions of 'sale' (e.g., including/excluding tax, shipping). - Action: Ensure consistent definitions and check for any delays in data synchronization. - Why Amazon Product Sales in Triple Whale Different From Amazon’s Official Dashboard? - Explanation: Differences may stem from Amazon's reporting delays, different sales event categorizations (e.g., FBA vs. FBM), or specific attribution rules. - Action: Cross-reference sales reports for the same period and understand Amazon's reporting nuances. - Why New vs. Returning Customer Count Different in Triple Whale vs. Shopify? - Explanation: Customer identification methods can vary. Triple Whale might use a broader definition based on site interactions, while Shopify relies on account creation or purchase history. - Action: Analyze how each platform identifies and segments customers. - Why Klaviyo (or Email/SMS) Revenue in Triple Whale Different from Klaviyo Dashboard? - Explanation: Attribution models, campaign tagging, and the timing of revenue recognition can cause differences. Triple Whale may attribute revenue based on multi-touch attribution, while Klaviyo might use last-touch. - Action: Compare attribution models and ensure consistent UTM tagging for campaigns. ``` -------------------------------- ### Using Ad Set Targeting Data for Meta (Facebook) Campaigns Source: https://triplewhale.readme.io/docs/using-adset-targeting-data This section guides users on leveraging ad set targeting data specifically for Meta (Facebook) campaigns. It provides example queries to analyze audience demographics, locations, and other targeting criteria within ad campaigns. Ad set targeting data is exclusively available for Meta (Facebook) data. ```APIDOC APIDOC: Title: Ad Set Targeting Data Analysis Description: Provides guidance and example queries for analyzing ad set targeting data from Meta (Facebook) campaigns. Availability: Meta (Facebook) data only. Use Cases: - Analyzing audience demographics. - Understanding location targeting. - Evaluating other targeting criteria. Example Queries: - Query to find campaigns targeting specific demographics. - Query to identify campaigns targeting particular geographic locations. - Query to analyze performance based on audience interests. ``` -------------------------------- ### SQL Examples: Product Purchase Patterns Source: https://triplewhale.readme.io/docs/sql-example-library Offers SQL queries to analyze product purchase sequences and identify popular first products, common next purchases, and the most frequently bought second products. ```SQL SELECT product_id, COUNT(*) AS first_purchase_count, AVG(order_total) AS average_order_value, SUM(order_total) AS lifetime_value FROM orders_table WHERE is_first_purchase = TRUE GROUP BY product_id ORDER BY first_purchase_count DESC; ``` ```SQL WITH RankedOrders AS ( SELECT customer_id, product_id, order_date, ROW_NUMBER() OVER(PARTITION BY customer_id ORDER BY order_date) as rn FROM orders_table ) SELECT ro1.product_id AS previous_product, ro2.product_id AS next_product, COUNT(*) AS purchase_sequence_count FROM RankedOrders ro1 JOIN RankedOrders ro2 ON ro1.customer_id = ro2.customer_id AND ro1.rn + 1 = ro2.rn GROUP BY ro1.product_id, ro2.product_id ORDER BY purchase_sequence_count DESC; ``` ```SQL WITH CustomerOrderSequence AS ( SELECT customer_id, product_id, order_date, LAG(product_id, 1) OVER (PARTITION BY customer_id ORDER BY order_date) AS previous_product_id FROM orders_table ) SELECT previous_product_id, product_id AS second_product_id, COUNT(*) AS count FROM CustomerOrderSequence WHERE previous_product_id IS NOT NULL GROUP BY previous_product_id, product_id ORDER BY count DESC; ``` -------------------------------- ### Triple Whale Data Troubleshooting Guides Source: https://triplewhale.readme.io/docs/sql-example-weekly-performance-metrics-roas-ctr-cvr Addresses common questions and discrepancies regarding Triple Whale data, comparing it with other platforms like Shopify, Amazon, and Klaviyo. ```APIDOC TripleWhaleDataDiscrepancies: - Why Total Revenue Across Channels Higher Than Store Revenue? - Explanation: Differences may arise from attribution models, refund handling, and currency conversions. - Action: Review attribution settings and refund policies in both Triple Whale and your store platform. - Why Total Sales in Shopify Not Match Total Sales in Triple Whale? - Explanation: Discrepancies can be due to order processing times, unfulfilled orders, or different definitions of 'sale' (e.g., including/excluding tax, shipping). - Action: Ensure consistent definitions and check for any delays in data synchronization. - Why Amazon Product Sales in Triple Whale Different From Amazon’s Official Dashboard? - Explanation: Differences may stem from Amazon's reporting delays, different sales event categorizations (e.g., FBA vs. FBM), or specific attribution rules. - Action: Cross-reference sales reports for the same period and understand Amazon's reporting nuances. - Why New vs. Returning Customer Count Different in Triple Whale vs. Shopify? - Explanation: Customer identification methods can vary. Triple Whale might use a broader definition based on site interactions, while Shopify relies on account creation or purchase history. - Action: Analyze how each platform identifies and segments customers. - Why Klaviyo (or Email/SMS) Revenue in Triple Whale Different from Klaviyo Dashboard? - Explanation: Attribution models, campaign tagging, and the timing of revenue recognition can cause differences. Triple Whale may attribute revenue based on multi-touch attribution, while Klaviyo might use last-touch. - Action: Compare attribution models and ensure consistent UTM tagging for campaigns. ```