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:
- Go to the Snowflake website (https://www.snowflake.com/) and click the "Get Started for Free" button.
- Fill out the registration form with your details, and then click the "Create Account" button.
- 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:
- Log in to your Snowflake account.
- Click on the "Databases" tab, and then click the "New Database" button.
- Enter a name for your database, and then click the "Create" button.
- Click on the database you just created, and then click the "New Worksheet" button.
- In the worksheet, enter the following SQL code to create a table:
- 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:
- Click on the "Data Warehouses" tab, and then click the "New Warehouse" button.
- Enter a name for your data warehouse, and then select the size and type of warehouse you want to create.
- 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:
- Click on the "Integrations" tab, and then click the "New Integration" button.
- Enter a name for your integration, and then select "Google Cloud Storage" as the destination.
- 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:
- Go to the Google Cloud Console (https://console.cloud.google.com/).
- Click on the "Storage" tab, and then click the "Create Bucket" button.
- Enter a name for your bucket, and then select the location and storage class you want to use.
- 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:
- Go to the Google Cloud Console (https://console.cloud.google.com/).
- Click on the "Functions" tab, and then click the "Create Function" button.
- Enter a name for your function, and then select "Cloud Storage" as the trigger.
- 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:
- In GTM, click on the container name in the navigation bar on the left side of the screen.
- Click on the "Tags" menu, and then click the "New" button.
- Give your tag a name, and then select "Google Cloud Storage" as the tag type.
- 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.
- 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:
- In GTM, click on the "Triggers" menu, and then click the "New" button.
- Give your trigger a name, and then select "Cloud Storage" as the trigger type.
- 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.
- 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:
- In GTM, click on the "Submit" button in the top right corner of the screen.
- Enter a version name and description, and then click the "Publish" button.