Install a Javascript Snippet Using GTM

1. Sign in into Google Tag Manager, navigate to the Tags option in the left menu, and click New to create a new tag.

The Tags section will be empty if you haven’t already created a container, and you will need to create your first tag.

2. Enter a name for the Tag in the Untitled Tag field and select Custom > Custom HTML under Choose tag type.

A list of available tags will be displayed, click on Custom HTML under Custom.

3. Paste your JavaScript code into the HTML text box.

For example, marketing snippets like the Facebook Pixel can be deployed into a website through a Custom HTML tag. Make sure your code is placed between the and tags. You can prioritize whether to fire the tag before or after another tag, and decide whether the tag will be fired once per page or once per event under Advanced Settings.

4. Choose a trigger to fire the JavaScript tag, save the tag, and preview the container to confirm whether the tag fires.

Following the previous Facebook example, choose to fire the pixel on All Pages and save the tag.