Short answer
Matching SQL text alone does not guarantee matching results.
A dashboard can supply saved settings that are not included when you copy its SQL into an API request. These can include the attribution model, attribution window, and whether purchases are reported by click date or purchase date.
To compare results, match the effective report settings as well as the SQL, dates, and filters.
Why identical SQL can return different results
The SQL text is only part of a report request. The dashboard may supply additional settings when it runs the query.
If your API request does not use equivalent settings, the two requests can include different purchases or assign them to different reporting dates.
For example, two reports can show the same date range but differ because one uses click-date reporting and the other uses purchase-date reporting.
Click-date reporting assigns purchase credit to the date of the attributed click.
Purchase-date reporting assigns purchase credit to the date the order was placed.
Example: A shopper clicks an ad on Monday and purchases on Wednesday. Under click-date reporting, the purchase credit can appear on Monday. Under purchase-date reporting, it appears on Wednesday.
What to check
Compare the following settings before treating the results as equivalent:
Setting | What should match |
Business scope | The same business or set of businesses. |
Reporting dates | The same resolved start and end dates, including the reporting timezone. |
Metric and source | The same metric definition, underlying data source, and currency. |
Filters | The same included and excluded channels, campaigns, products, order types, and other applicable filters. |
Attribution model | The same method for assigning purchase credit. |
Attribution window | The same lookback window, where the model supports a configurable window. |
Reporting date basis | Click date or purchase date. |
Grouping | The same reporting level, such as channel, campaign, or ad. |
Matching the displayed date range is not enough if the attribution window or reporting date basis differs.
How to investigate the difference
1. Record the dashboard settings
Open the dashboard you are comparing and record its reporting dates, filters, business scope, and metric.
For attribution results, also record the selected model, attribution window, and click-date or purchase-date setting.
2. Compare the API request
Check the request and query against the dashboard settings. Do not assume that copying the SQL also copies saved dashboard settings.
For request syntax and date-parameter handling, use the Execute Custom SQL Query reference.
For attribution queries using the Pixel Joined table, consult the Pixel Joined Table reference for the relevant model, window, and date-basis fields or parameters.
3. Run the comparison again
After aligning the settings, rerun the API request and compare the same metric at the same reporting level.
Matching the settings helps rule out common causes. It does not guarantee that every discrepancy is resolved.
Still need help?
If the results still differ, contact Triple Whale Support with:
The dashboard name and the metric you are comparing.
The SQL query.
The API request with API keys, tokens, and other credentials removed.
The reporting dates, timezone, and filters.
The attribution model, window, and reporting date basis, if applicable.
Both results and when each was retrieved.
Include screenshots of the dashboard settings where useful, with sensitive information removed.
