Organizations that advertise on Pinterest often wish to analyze how users interact with their collaterals. Pinterest exposes this data through its APIs and provides basic analytics functionalities through its admin interface. But nothing can beat the convenience of having all the analytics data in one place and processing them with the help of your favorite data warehouse.
    This article is about how to connect Pinterest Ads to Snowflake – A completely managed cloud-based data warehouse. 

    Prerequisites

    • Pinterest Business Account
    • Snowflake User Account
    • Python 3.6 or above.

    What are Pinterest Ads?

    pinterest logo

    Pinterest is a platform that enables the discovery and saving of ideas using images, GIFs, and small duration videos. Pinterest calls these assets pins. Pinterest provides support for publishing commercial advertisements and marketing your brands through its platform. A simple and intuitive user interface without the typical distractions of a social website makes it a favorite among people who want to try different things on their own and share them with others. 

    Key Features of Pinterest Ads

    • Gain Brand Awareness: Advertisements on Pinterest are an effective method for raising online brand awareness and recognition.
    • Increase Your Reach, Traffic, and Sales: If you use images of high quality within Pinterest search, you’ll be able to attract more visitors to your websites and landing pages, which will ultimately lead to an increase in sales, brand awareness, and traffic. 
    • Pinterest Search: The fact that content that has been shared on Pinterest can be located again and again through keywords, interests, and boards raises the possibility that it will drive traffic to your company over the long term.
    Boost Your Pinterest Ads to Snowflake Migration with Hevo

    Migrating data from Pinterest Ads to Snowflake doesn’t have to be complicated. Simplify the process with Hevo’s no-code platform for a seamless experience. 

    With Hevo, you can:

    • Easily extract data from Pinterest Ads and over 150 other connectors.
    • Customize your data for Snowflake using drag-and-drop tools and custom Python scripts.
    • Load data at lightning speed into Snowflake, ensuring it’s ready for analysis.
    Get Started with Hevo for Free!

    What is Snowflake?

    pinterest ads to snowflake: snowflake logo

    Snowflake is a completely managed data warehouse service that can be used over the web. Snowflake provides a unique pricing mechanism that separates storage costs and processing costs. Snowflake supports multiple clouds and hence is a favorite among organizations that do not want to lock in with a single vendor. Snowflake can execute queries in lightning-quick time. It supports JSON format and querying them through standard SQL. 

    Key Features of Snowflake

    • Snowflake enables you to enhance your Analytics Pipeline by transitioning from nightly Batch Loads to Real-time Data Streams, allowing you to improve the quality and speed of your analytics. By enabling Secure, Concurrent, and Monitoring Access to your Data Warehouse across your organization, you can improve the quality of analytics at your company.
    • Snowflake uses the Caching Paradigm to deliver the results from the cache swiftly. To avoid re-generating the report when nothing has changed, Snowflake employs Persistent (within the session) Query results.
    • Snowflake allows you to get rid of silos and ensure access to meaningful insights across the enterprise, resulting in better Data-driven Decision-Making.

    Pinterest Ads to Snowflake Data Migration

    Method 1: Use Hevo to Set Up Pinterest Ads for Snowflake

    Using Hevo, you can integrate Pinterest Ads with Snowflake in the following two steps:

    • Step 1: Configure Pinterest Ads as the Source in your Pipeline by following these steps:
      • Step 1.1: Click + ADD PINTEREST ADS ACCOUNT on the Configure your Pinterest Ads account page.
    pinterest ads to snowflake: configure pinterest ads account
    • Step 1.2: Use your Pinterest Business account to log in.
    • Step 1.3: To grant Hevo access to your Pinterest Ads data, click Continue.
    • Step 1.4: Enter the information on the Configure your Pinterest Ads Source page
    • Step 1.5: Simply press TEST & CONTINUE.

    Step 2: Set up Snowflake as a destination

    • Step 2.1: Select Snowflake from the Add Destination page.
    • Step 2.2: Set the parameters on the Configure your Snowflake Destination page
    pinterest ads to snowflake: configure snowflake as destination
    • Step 2.3: Click Test Connection to test connectivity with the Snowflake warehouse.
    • Step 2.4: Once the test is successful, click SAVE DESTINATION.
    Migrate data from Pinterest Ads to Snowflake
    Migrate data from Facebook Ads to Snowflake
    Migrate data from Amazon Ads to Snowflake

    Method 2: Using Custom Code to Move Data from Pinterest Ads to Snowflake

    To loading Data From Pinterest Ads to Snowflake, you will use Pinterest Analytics Python API to retrieve data from Pinterest. The JSON data will then be uploaded to Snowflake through the web interface. 

    • Step 1: The first step to connect Pinterest Ads to Snowflake is to gain access to Pinterest Analytics API. This can be done from the developer console.
    • Step 2: Log in with your business account and create an App. After the approval process, you will receive an Application ID and secret that can be used to access the Analytics API.
    • Step 3: Clone the official Pinterest API Repository to access the APIs. Execute the below command to do this.
    git clone https://github.com/pinterest/api-quickstart.git
    • Step 4: From the top-level directory of the cloned repository, type the below commands to configure the Application ID and secret.
    $ cd common/scripts
    $ cp api_app_credentials.template api_app_credentials
    • Step 5: Edit the api_app_credentials file to add the Application ID and secret.
    • Step 6: Now initiate a Python script and configure the below import statements.
    import argparse
    import json
    import sys
    from os.path import abspath, dirname, join
    
    sys.path.append(abspath(join(dirname(__file__), "..", "src")))
    
    from api_config import ApiConfig
    from arguments import common_arguments
    from utils import input_number, input_path_for_write
    from access_token import AccessTokenfrom advertisers import Advertisersfrom analytics import AdAnalytics, PinAnalytics, UserAnalyticsfrom oauth_scope import Scopefrom user import User
    • Step 7: Use the below snippet to fetch the access token.
    access_token = AccessToken(api_config, name=args.access_token)
        scopes = [Scope.READ_USERS]
        scopes += [Scope.READ_ADVERTISERS]
        access_token.fetch(scopes=scopes)
    • Step 8: Use the below snippet to get metrics about your pin.
    analytics = (
                PinAnalytics(“<Your_pin_id”, api_config, access_token)
                .last_30_days()
                .metrics({"IMPRESSION", "PIN_CLICK"})   results = analytics.get() 

    NOTE: Ensure to change the pin ID in the above snippet to the one you want to fetch analytics information.

    • Step 9: Write the results to a JSON file using the below snippet.
    with open(“Path_to_json_file”, "w") as json_file:
            json.dump(results, json_file, indent=2)

    Ensure that you add the correct path where you want the JSON file to be saved in the above snippet.

    • Step 10: Save the completed script file and execute the script to get the JSON file. 
    • Step 11: You will not upload the JSON file to a Snowflake table. Since Snowflake supports JSON loading and querying, you can use a single-column Snowflake table to load our raw JSON file. For this, first, head to the Snowflake Web Console and create a table with the below Query.
    CREATE TABLE METRICS_JSON (RAW_JSON VARIANT);
    • Step 12: Once the table is created, head to the databases section in Snowflake and click ‘Load Data’.
    • Step 13: Select the JSON file that you have generated using the Python Script and click Next.

    That completes the sequence for loading data from Pinterest Ads to Snowflake. Even though you successfully loaded the data, it required us to develop quite a bit of code.

    Limitations of Manually Connecting Pinterest Ads to Snowflake

    The Limitations of Manually Connecting Pinterest Ads to Snowflake are:

    • This method of Pinterest Ads to Snowflake integration uses synchronous APIs from Pinterest. While this is fine for smaller amounts of data, it is not a good approach for larger data volumes.  The use of an asynchronous API will further complicate the code.
    • This approach of connecting Pinterest Ads to Snowflake is suitable for a one-time load. In reality, there will be period loads and these loads have to be managed by an automated module.
    • In most cases, the data has to be processed and transformed before loading into data warehouses. This is not addressed here.

    Why Integrate Pinterest Ads to Snowflake?

    • Pinterest Ads helps to identify target audiences, selling platforms, payment gateways, and logistical channels.
    • Those who have interacted with previous marketing efforts (email, SMS, social media) are targeted.
    • This involves downloading, comparing, and analyzing data silos from other platforms and marketing tools, making it time-consuming. 
    • Improvement in targeting would also derive from the need to better profile their audience through analytics on data from platforms such as e-commerce, CRMs, and customer support systems.
    • It is virtually impossible to make precise analysis at the time of analysis because of gathering and processing data from various sources.
    • Businesses match the data from Pinterest Ads with Snowflake for speedier, more accurate analysis and reporting.

    Conclusion

    Pinterest is an idea-sharing social network that is a great alternative for building a brand. Marketing teams usually want to keep track of every activity of the user while they build brands. This article detailed the approach to loading the user activity data from Pinterest Ads to Snowflake. This helps marketing teams to analyze the Pinterest engagement data in a proper data warehouse without having to depend only on the default analytics dashboard provided. In case you are looking for a no-code approach to solve this problem, you should check Hevo.

    Hevo offers a no-code data pipeline that can automate your data transfer process, from 150+ sources (including 60+ Free Sources) such as Pinterest Ads and Cloud-based Data Warehouses like Snowflake, Google BigQuery, etc. Hence allowing you to focus on other aspects of your business like Analytics, Marketing, Customer Management, etc.

    Want to take Hevo for a spin? Sign up for a 14-day free trial and experience the feature-rich Hevo suite firsthand. You can also have a look at the unbeatable pricing that will help you choose the right plan for your business needs.

    FAQ on Pinterest Ads to Snowflake

    1. Can you run ads on Pinterest?

    Yes, you can run ads on Pinterest through its advertising platform, which allows you to create and manage various types of ads including promoted pins and video ads.

    2. How to load Pinterest ads to Snowflake?

    To load Pinterest ads data into Snowflake, you would typically export the data from Pinterest to a file (e.g., CSV or JSON), upload it to a cloud storage service like AWS S3, and then use Snowflake’s data loading capabilities to import the data from the storage into Snowflake, or you can just use Hevo.

    3. Is Pinterest Ads data supported on Snowflake?

    Pinterest Ads data can be loaded into Snowflake, but you might need to use ETL tools or custom scripts to facilitate the integration, as Snowflake doesn’t have native connectors for Pinterest Ads.

    Talha
    Software Developer, Hevo Data

    Talha is a Software Developer with over eight years of experience in the field. He is currently driving advancements in data integration at Hevo Data, where he has been instrumental in shaping a cutting-edge data integration platform for the past four years. Prior to this, he spent 4 years at Flipkart, where he played a key role in projects related to their data integration capabilities. Talha loves to explain complex information related to data engineering to his peers through writing. He has written many blogs related to data integration, data management aspects, and key challenges data practitioners face.