Step By Step Guide - Snowflake to Google Tag Manager

date
Apr 13, 2023
slug
guide-snowflake-gtm
status
Published
tags
gtm
google-tag-manager
snowflake
guide
summary
Step By Step Guide - Snowflake to Google Tag Manager
type
Post
Here's a detailed step-by-step guide for setting up an integration between Snowflake and Google Tag Manager:
Step 1: Set up a Snowflake Account
If you don't already have a Snowflake account, you'll need to create one first. Here are the steps to create a Snowflake account:
  1. Go to the Snowflake website (https://www.snowflake.com/) and click the "Get Started for Free" button.
  1. Fill out the registration form with your details, and then click the "Create Account" button.
  1. Follow the on-screen instructions to set up your account.
Step 2: Create a Snowflake Database and Table
After creating your Snowflake account, the next step is to create a database and table to store your data. To create a database and table, follow these steps:
  1. Log in to your Snowflake account.
  1. Click on the "Databases" tab, and then click the "New Database" button.
  1. Enter a name for your database, and then click the "Create" button.
  1. Click on the database you just created, and then click the "New Worksheet" button.
  1. In the worksheet, enter the following SQL code to create a table:
    1. Click the "Run" button to create the table.
    Step 3: Set up a Snowflake Data Warehouse
    To set up a Snowflake data warehouse, follow these steps:
    1. Click on the "Data Warehouses" tab, and then click the "New Warehouse" button.
    1. Enter a name for your data warehouse, and then select the size and type of warehouse you want to create.
    1. Click the "Create" button.
    Step 4: Create a Snowflake Integration
    After setting up your database and data warehouse in Snowflake, the next step is to create a Snowflake integration. To create an integration, follow these steps:
    1. Click on the "Integrations" tab, and then click the "New Integration" button.
    1. Enter a name for your integration, and then select "Google Cloud Storage" as the destination.
    1. Follow the on-screen instructions to set up the integration.
    Step 5: Set up a Google Cloud Storage Bucket
    To set up a Google Cloud Storage bucket, follow these steps:
    1. Go to the Google Cloud Console (https://console.cloud.google.com/).
    1. Click on the "Storage" tab, and then click the "Create Bucket" button.
    1. Enter a name for your bucket, and then select the location and storage class you want to use.
    1. Click the "Create" button.
    Step 6: Set up a Google Cloud Function
    After setting up your Google Cloud Storage bucket, the next step is to set up a Google Cloud Function to trigger when new data is added to the bucket. To set up a Google Cloud Function, follow these steps:
    1. Go to the Google Cloud Console (https://console.cloud.google.com/).
    1. Click on the "Functions" tab, and then click the "Create Function" button.
    1. Enter a name for your function, and then select "Cloud Storage" as the trigger.
    1. Follow the on-screen instructions to set up the function.
    Step 7: Set up a Tag in GTM
    After setting up the Google Cloud Function, the next step is to set up a tag in GTM to trigger when new data is added to the bucket. To set up a tag, follow these steps:
    1. In GTM, click on the container name in the navigation bar on the left side of the screen.
    1. Click on the "Tags" menu, and then click the "New" button.
    1. Give your tag a name, and then select "Google Cloud Storage" as the tag type.
    1. Enter the following values for the tag configuration:
        • Bucket: Enter the name of your Google Cloud Storage bucket.
        • Object Prefix: Enter the path to the Snowflake file you want to import.
        • Service Account: Enter the name of the service account you created in Step 5.
    1. Click the "Save" button to create the tag.
    Step 8: Set up a Trigger in GTM
    After setting up the tag in GTM, the next step is to set up a trigger to fire the tag when new data is added to the bucket. To set up a trigger, follow these steps:
    1. In GTM, click on the "Triggers" menu, and then click the "New" button.
    1. Give your trigger a name, and then select "Cloud Storage" as the trigger type.
    1. Enter the following values for the trigger configuration:
        • Bucket: Enter the name of your Google Cloud Storage bucket.
        • Object Prefix: Enter the path to the Snowflake file you want to import.
        • Event Type: Select "Finalize/Create" as the event type.
    1. Click the "Save" button to create the trigger.
    Step 9: Publish the Container in GTM
    After setting up the trigger, the final step is to publish the container in GTM. To publish the container, follow these steps:
    1. In GTM, click on the "Submit" button in the top right corner of the screen.
    1. Enter a version name and description, and then click the "Publish" button.

    © Hao Liu 2023