Send offline conversions to Snapchat¶
Snapchat is a social media platform for accessing pictures and messages for a short time. Snapchat offers a self-serve platform from which brands can manage ads and advertising campaigns.
Note
This topic describes uploading a CSV file to Snapchat yourself. To have Amperity send offline conversion events directly to the Snapchat Conversions API, see Send offline conversion events to Snapchat. The two paths require different queries. The query on this page returns pre-hashed values and the column names that Snapchat requires in an uploaded file. The connector hashes values itself, so a pre-hashed value sent through the connector is hashed twice and cannot be matched.
Upload a CSV file that has offline conversions and meets events file requirements to Snapchat.
Caution
This destination is available for sending query results to Snapchat after it is configured by a Datagrid Operator or your Amperity representative.
If this destination cannot be selected for orchestrations ask your Datagrid Operator or Amperity representative to configure a destination for sending query results to Snapchat.
Build a query¶
Use a query to return the fields that align to the events file requirements that are supported by Snapchat for use with offline conversions .
For example:
1SELECT
2 TO_HEX(SHA256(TO_UTF8(LOWER(TRIM(mc.email))))) AS email
3 ,uit.order_datetime AS timestamp
4 ,'purchase' AS event_type
5 ,uit.item_quantity AS number_items
6 ,uit.item_revenue AS price
7 ,uit.order_id AS transaction_id
8 ,uit.item_quantity AS quantity
9FROM Merged_Customers mc
10INNER JOIN Unified_Itemized_Transactions uit
11ON mc.amperity_id = uit.amperity_id
12WHERE mc.email IS NOT NULL
13AND uit.order_datetime >= CURRENT_DATE - INTERVAL '7' day
14AND COALESCE(uit.is_return, false) = false
15AND COALESCE(uit.is_cancellation, false) = false
Note
Bound the query to a recent window so each file contains new conversions instead of the full transaction history, and exclude returns and cancellations so they are not reported as conversions. Use COALESCE for both flags: each is null when the status is unknown, and a bare is_return = false comparison drops those rows instead of keeping them.
You can download the results of this query directly from the Query Editor in Amperity, and then upload the file directly to Snapchat. Or you can use an orchestration to send the CSV file to cloud storage or an SFTP bucket.
Important
Validate the audience with Snapchat by using a sample audience with a very small membership. For example: 10 or 100 members or the minimum audience size recommended by Snapchat. Send the sample audience to Snapchat and verify the sample audience is correct in Snapchat. Make adjustments if necessary. Only send full audiences after validation is complete.