# Google Tag Manager

It is very easy to add Optinly to your website. This guide walks you through the steps to use the Google Tag Manager to embed Optinly to your website.

1. Login to [Google Tag Manager](https://tagmanager.google.com/)
2. In your Workspace, click Add New Tag

![](/files/P9izYk8WgRkpQU1BdRDq)

3\. Give it a Title

![](/files/YdzRo8unpESb48UuAfFS)

4\. Click on the "Tag configuration" and choose the tag type as: Custom Html

![](/files/3BGOfqJxg7DUAPHGzhM3)

5\. From your Optinly dashboard -> Installation instructions, copy the Javascript and paste it into the Tag Editor

IMPORTANT: Make sure you check "Support document.write" checkbox. Otherwise, Optinly will not load

![](/files/FKriR0c7pUj77s2ORAX3)

6\. Click and Expand the "Advanced Settings". Choose the Tag firing options and set it to "Once per page"

![](/files/SsQ2tXC32giXuuvGKimI)

7\. Click on the Trigger configuration and choose "All Pages". Since you may have popups being used in different parts of the website, it is recommended to have this snippet loaded in all pages of your site.

![](/files/bKpJeqEAAYHKfwibDZuD)

8\. Save the Tag&#x20;

![](/files/FSdCFuW9rOkbWVEYyyx9)

9\. Publish your changes

That's all. You have now loaded the Optinly script via the Google Tag Manager

## Next Steps <a href="#next-steps" id="next-steps"></a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.optinly.com/installation/google-tag-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
