# Quick start guide for using Snowplow in Google Tag Manager
> Add Snowplow v4 custom templates to your Google Tag Manager workspace and configure basic tracking. Import templates from the GTM gallery and set up your collector endpoint for event tracking.
> Source: https://docs.snowplow.io/docs/sources/google-tag-manager/quick-start/
> Documentation index: https://docs.snowplow.io/llms.txt

This guide will walk you through the initial setup for Snowplow in Google Tag Manager.

## Adding the Templates

To get started with Snowplow in Google Tag Manager, you will need to add the Snowplow Tag Template and the Snowplow Settings Variable Template to your GTM workspace.

Links to both templates can be found [here](/docs/sources/google-tag-manager/).

### Snowplow Tag Template

1. Navigate to the `Templates` tab in your GTM workspace and click the `Search Gallery` button in the `Tag Templates` section.

![GTM Templates tab showing the Tag Templates section with the Search Gallery button highlighted and an empty state, and the Variable Templates section below it also with a Search Gallery button.](/assets/images/tag-template-search-0ec39a0b52c7894a89449492ad0308ce.png)

2. Search for "Snowplow v4"

![Community Template Gallery search panel with \&quot;Snowplow v4\&quot; entered in the search field, showing one result: Snowplow v4 by snowplow with a green verified checkmark.](/assets/images/search-27677eb5bfee0e80f905e1f996b157ce.png)

3. Click on the template, and then click `Add to Workspace` in the next screen. Review the permissions and click `Add` to finalize the import.

### Snowplow Settings Variable Template

The Snowplow Settings Variable template is used to configure the Snowplow tracker, such as the collector endpoint, privacy options, and tracker version. Although possible to use the Snowplow tag without the settings variable, it's highly recommended to use it for ease of configuration, along with keeping the tracker configuration separate from the tag.

1. Again in the `Templates` tab in your GTM workspace, click the `Search Gallery` button in the `Variable Templates` section.

![GTM Templates tab with the Search Gallery button in the Variable Templates section highlighted, and the Tag Templates section above it showing an empty state.](/assets/images/variable-template-search-2d20f633b21d310f8664a688d210f0d3.png)

2. Search for "Snowplow v4 Settings"

3. Click on the template, and then click `Add to Workspace` in the next screen. No permissions are required, so click `Add` to finalize the import.

## Configuring the Settings Variable

1. Navigate to the `Variables` tab in your GTM workspace and click `New` in `User-Defined Variables`.

![GTM Variables tab showing built-in variables (Event, Page Hostname, Page Path, Page URL, and Referrer) and the User-Defined Variables section with the New button highlighted and an empty state.](/assets/images/variables-new-c32b98d0e9bac37687e92d6234177414.png)

2. Select `Snowplow v4 Settings` from the list of available variables.

3. Under `Tracker Options`, enter your Snowplow collector endpoint set up when [configuring your collector](/docs/pipeline/collector/).

![GTM Variable Configuration panel for Untitled Variable showing type set to Snowplow v4 Settings, Tracker Options with Tracker Name spTracker and Collector Endpoint Hostname collector.mydomain.com, and JavaScript Tracker with library set to jsDelivr and version 4.0.2.](/assets/images/variable-9147f9ce6c3ee4fe6ed7770f3eee1fa7.png)

> **Info:** You might consider using conditional variables to set the Collector endpoint based on the environment, e.g. sending data to [Snowplow Micro](/docs/testing/snowplow-micro/) during development.

4. Under `JavaScript Tracker`, choose a hosting option. To get started quickly, select either `unpkg` or `jsDelivr` and enter a library version.

5. Give your variable a name and click `Save`.

## Implementing the Snowplow Tag

In this section, we will create a simple tag to fire a page view event.

1. Navigate to the `Tags` tab in your GTM workspace and click `New`.

![GTM Tags tab with the New button highlighted and an empty state message indicating no tags have been created yet.](/assets/images/new-tag-e29e5a0837ec41a24d07c0bf2c89e5af.png)

2. Click on the `Tag Configuration` section and select `Snowplow v4`.

3. Set the `Tag Type` to `Page View`, if it is not already selected.

4. Under `Tracker Initialisation`, select the Snowplow Settings variable we created earlier.

5. Add a trigger to the tag. This will determine when the tag is fired. For a page view tag, you can use the built-in `All Pages` trigger.

6. Give your tag a name and click `Save`.

## Testing the Tag

To test the tag, you can use the GTM preview mode. Click the `Preview` button in the top right of the GTM interface. This will open a new tab with your website and the GTM preview console.

Ensure that you see the Page View event in your Snowplow pipeline. If you don't have a full pipeline set up yet, you can use [Snowplow Micro](/docs/testing/snowplow-micro/) or [Snowplow Inspector](/docs/testing/snowplow-inspector/) to check that the event is sent correctly.
