Easily move your data from Snapchat To Snowflake to enhance your analytics capabilities. With Hevo’s intuitive pipeline setup, data flows in real-time—check out our 1-minute demo below to see the seamless integration in action!
Businesses are driven by data and as such, companies are investing resources in technologies that can help improve the way they react to the data being produced daily. One such way in which organizations are trying to derive valuable insight from data is by integrating available technologies with other platforms to make the most out of their data by gaining much-needed comprehension to drive businesses forward.
This article is going to present easy methods by which you can connect Snapchat to Snowflake. Snapchat is a messaging platform that is used by millions around the world to share and upload images, text, and so on while Snowflake has become a household name when it comes to Data Warehousing.
What is Snapchat?
Snapchat is a free downloadable messaging application predominantly used for sharing photos, videos, text, and drawings, it has become hugely popular, especially among young people. Snapchat allows you to send messages directly to an individual or through group messaging.
Snapchat is unique from other available messaging applications as it has features that allow you to express yourself with million of lenses, learn about the world through your map known as Snapchat maps, share your creativity, and most importantly, it enables messages to disappear quickly after some few seconds as they are only available for a short time before they become inaccessible by the recipients though, the details of the sender and the timestamp would still be visible as it remains. It also allows users to keep photos in a password-protected space known as my eyes only.
What is Snowflake?
Snowflake is a cloud-based Software-as-a-Service (SaaS) platform that offers cloud-based storage and analytics services. Its cloud data warehouse is built on Amazon Web Service, Microsoft Azure, and Google infrastructure, providing a platform for storing and retrieving data. Snowflake has a unique architecture that separates its storage unit from its compute unit, thereby scaling differently so customers can use and pay for both independently.
With Snowflake, there is no hardware or software to select, install, configure, or manage, therefore, making it ideal for organizations that do not want to have dedicated resources for setup, maintenance, and support for in-house servers.
Methods to Connect Snapchat to Snowflake
With the integration of Snapchat Snowflake, you can extract your marketing data from Snapchat, transform it, and load it seamlessly into Snowflake where your decision-making process will be greatly improved and quickly implemented.
Method 1: Connect Using Hevo
Hevo provides Amazon Redshift as a destination for loading/transferring data from any source system, including Snapchat. You can refer to Hevo’s documentation for Permissions, User Authentication, and Prerequisites for Amazon Redshift as a destination.
Configure Snapchat as a Source
Configure Snapchat as the Source in your Pipeline by following the steps below:
- Step 1: In the Asset Palette, select PIPELINES.
- Step 2: In the Pipelines List View, click + CREATE.
- Step 3: Select Snapchat on the Select Source Type page.
- Step 4: Click + ADD SNAPCHAT ADS ACCOUNT on the page that asks you to configure your Snapchat ads account.
- Step 6: To grant Hevo access to your Snapchat Ads data, click Continue.
- Step 7: Enter the information below in the Configure your Snapchat Ads Source page:
- Pipeline Name: A name for the Pipeline that is unique and does not exceed 255 characters.
- Select Organizations: The Snapchat company whose information you want to take in. You can choose from a variety of organizations.
- Select Ad Accounts: The account for Snapchat Ads whose data you want to download. You can choose several Ad Accounts.
- Historical Sync Duration: The time it takes for historical data to be synced with the Destination. 1 Year is the default value.
- Step 8: Click TEST & CONTINUE.
- Step 9: Set up the Destination and configure the data ingestion.
Configure Snowflake as a Destination
To set up Snowflake as a destination in Hevo, follow these steps:
- Step 1: In the Asset Palette, select DESTINATIONS.
- Step 2: In the Destinations List View, click + CREATE.
- Step 3: Select Snowflake from the Add Destination page.
- Step 4: Set the following parameters on the Configure your Snowflake Destination page:
- Destination Name: Give your destination a unique name.
- Database Cluster Identifier: The IP address or DNS of the Snowflake host is used as the database cluster identifier.
- Database Port: The port on which your Snowflake server listens for connections is the database port. 5439 is the default value.
- Database User: In the Snowflake database, a user with a non-administrative position.
- Database Password: The user’s password.
- Database Name: The name of the destination database into which the data will be loaded.
- Database Schema: The Destination database schema’s name. The default setting is public.
- Step 5: To test connectivity with the Snowflake warehouse, click Test Connection.
- Step 6: When the test is complete, select SAVE DESTINATION.
Integrate data from Snapchat to Snowflake
Integrate data from Snapchat to BigQuery
Integrate data from Linkedin Ads to Snowflake
Method 2: Manually Connect Snapchat to Snowflake
Snapchat to Snowflake extraction can be done with a few clicks, after which you can build data pipelines and visualize your data using powerful data visualization tools.
Extracting data from Snapchat is done by using its marketing API which is available to developers as it has no restrictions on the minimum size and scope of what you want to build to maintain access to the platform. In this method, you will use the Snapchat Conversion API (CAPI) to illustrate this.
The Snapchat Conversion API is a structured interface that allows users to directly pass web, app, and offline events to Snap via a Server-to-Server (S2S) integration. You can do this on Snapchat through direct integration.
Direct Integration
This method involves direct integration with the conversion API and it gives you control over the integration process but first, you have to activate the Marketing API. To activate access to Snapchat’s Marketing API, a business account would need to be set up, before doing the following:
- Step 1: Log in to Ads Manager.
- Step 2: Click the menu in the top corner and select Business Details.
- Step 3: Click +OAuth App.
- Step 4: Click Agree to the terms and conditions to activate access.
- Step 5: Click on Save.
Having done this, you then proceed to access Snapchat’s Conversion API. To achieve this, a business account must be set up where you can generate a token on the business page of Ads Manager to make Conversion API calls. This is shown in the steps below:
- Step 1: Log in to Ads Manager.
- Step 2: Click the menu in the top corner and select Business Details.
- Step 3: Under the OAuth App section, a section Conversion API Tokens would be visible, click on the Generate Token button to generate a new token.
- Step 4: Copy the token to be used as an OAuth token and include the token header e.g Authorization: Bearer <<Newly generated Conversion API token>>.
- Step 5: Multiple tokens can be generated and you can delete tokens to invalidate them.
When sending data through the Conversion API, one or a combination of the following parameters are required to get a successful response and improve performance: hashed_email, hashed_phone, hashed_ip, and user_agent. Additional parameters which can be passed with each event, whether WEB, MOBILE_APP, or OFFLINE are listed here.
Using the API
As stated earlier, the Snapchat Conversion API allows the passing of web, app, and offline events to Snap through a Server-to-Sever integration in Snapchat to Snowflake Integration. These Conversions API requests are tied to unique identifiers that link the server events to your Snapchat ad account. Pixel ID is used for WEB and OFFLINE events while Snapchat App ID is used for APP events only.
To have clean data, each identifier be it text email, mobile identifiers, IP addresses, or phone numbers should be normalized before hashing. This can be done by removing white spaces found at the beginning and end of email addresses, converting all characters to lower cases, including country codes in phone numbers, providing the UNIX timestamp calculated in seconds of the conversion event, etc.
Depending on the type of events you will be reporting to Snap, you will be required to set up your Snap App ID or a Pixel ID. The ID determines the parameters you will pass when sending events.
The Web property carries a pixel_id and it shows events taking place on a web property like a website, the Mobile App property has a snap_app_id showing events taking place within an App, and finally, the Offline property has a pixel_id that measures events taking place in-store, over the phone or online but are not Pixable.
Below are examples of what a structured Conversion API request looks like for both Snap App ID and Pixel ID in this Integration.
{
"pixel_id":"783c04c9-cd00-485a-ab54-02f0832dfc24",
"timestamp":"1645723911000",
"event_type":"VIEW_CONTENT",
"event_conversion_type":"WEB",
"event_tag": "badger_tunneling",
"page_url":"https://www.example.com/tunneling",
"hashed_email":"20e468ca5f7903e80fe3aa79ac3b8f1436f99163a9802b55891f38be95b7959e",
"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15",
"hashed_ip_address":"1150a143ae46d77bca2f9f4429f8c65d4d746edc37b769b044659b820493d0db"
}
Example of Conversion API for Pixel ID:
{
"snap_app_id":"fb5b83ec-c593-4a64-9c6d-a0eb9da0edba",
"app_id":"447188370",
"timestamp":"1636574053",
"event_type":"PAGE_VIEW",
"event_conversion_type":"MOBILE_APP",
"event_tag": "instore",
"device_id":"9ec84f2eddcff338084a8c51808a45034c9286dc427a4cb01b8688b7b823be28",
"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15",
"hashed_ip_address":"1150a143ae46d77bca2f9f4429f8c65d4d746edc37b769b044659b820493d0db"
}
Example of Conversion API for Pixel ID
The expected response for both cases would be seen as displayed below.
{
"status": "SUCCESS",
"reason": "All records processed"
}
Further examples of Conversion APIs used for various purposes are shown below.
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer meowmeowmeow" \
-d '{
"app_id": "447188370",
"snap_app_id": "3984298349849",
"timestamp": "1521504154084",
"event_type": "APP_INSTALL",
"event_conversion_type": "MOBILE_APP",
"event_tag": "appsignups",
"transaction_id": "3409181200909",
"hashed_mobile_ad_id": "9543d100cf0775a3926d66cfbc557941a79c81370b019e5c927063e99b8e4aaa",
"hashed_email": "f13ff72f0a7cf3f0d187f4e4f6c41110e4bbd2d7560ede70ca68bd0b8b7fdc15",
"hashed_phone_number": "d10cad0775a3926d66cfbc557941a79c81370b019e5c927063e99b8e4aaa",
"hashed_idfv": "d10cad0775a3926d66cfbc557941a79c81370b019e5c927063e99b8e4aca",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0",
"hashed_ip_address": "d10cad0775a3926d66cfbc557941a79c81370b019e5c927063e99b8e4bbb",
}' \
https://tr.snapchat.com/v2/conversion
App Install Conversion
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer meowmeowmeow" \
-d '{
"app_id": "447188370",
"snap_app_id": "3984298349849",
"timestamp": "1521504154084",
"event_type": "PURCHASE",
"event_conversion_type": "MOBILE_APP",
"event_tag": "retention",
"price": "43",
"currency": "usd",
"transaction_id": "3409181200909",
"hashed_mobile_ad_id": "9543d100cf0775a3926d66cfbc557941a79c81370b019e5c927063e99b8e4aaa",
"hashed_email": "f13ff72f0a7cf3f0d187f4e4f6c41110e4bbd2d7560ede70ca68bd0b8b7fdc15"
"hashed_phone_number": "d10cad0775a3926d66cfbc557941a79c81370b019e5c927063e99b8e4aaa",
"hashed_idfv": "9543d100cf0775a3926d66cfbc557941a79c81370b019e5c927063e99b8e4aaa",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0",
"hashed_ip_address": "9543d100cf0775a3926d66cfbc557941a79c81370b019e5c927063e99b8e4aaa",
}' \
https://tr.snapchat.com/v2/conversion
App Purchase Conversion for Snapchat to Snowflake Integration
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer meowmeowmeow" \
-d '{
"pixel_id":"67d34640-b7a4-42a8-b821-6434d70f08a4",
"timestamp": "1521504154084",
"event_type": "PAGE_VIEW",
"event_conversion_type": "WEB",
"event_tag": "web_traffic",
"user_agent": Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0",
"hashed_ip_address": "d100cf0775a3926d66cfbc557941a79c81370b019e5c927063e99b8e4aad",
}' \
https://tr.snapchat.com/v2/conversion
Web Page View Conversion
The expected response for the examples above is displayed below.
{
"status": "SUCCESS",
"reason": "All records processed"
}
Integrate Data to Snowflake in Minutes!
No credit card required
Conclusion
This article has looked at how to integrate Snapchat to Snowflake. It mentioned how this could be done through direct integration that involved setting up Snapchat’s Conversion API. It concluded by walking you through the process and showing code snippets for various Conversion API endpoints like app purchase conversion, web page view conversion, app install conversion, etc. alongside possible responses.
However, as a Developer, extracting complex data from a diverse set of data sources like Databases, CRMs, Project management Tools, Streaming Services, and Marketing Platforms to your Database can seem to be quite challenging. If you are from non-technical background or are new in the game of data warehouse and analytics, Hevo Data can help. Sign up for Hevo’s 14-day free trial and experience seamless data migration.
Ofem Eteng is a seasoned technical content writer with over 12 years of experience. He has held pivotal roles such as System Analyst (DevOps) at Dagbs Nigeria Limited and Full-Stack Developer at Pedoquasphere International Limited. He specializes in data science, data analytics and cutting-edge technologies, making him an expert in the data industry.