---
title: Deploy widget with Google Tag Manager
slug: content-recommendations/docs/setup-via-tag-manager
createdAt: 2026-08-05T19:40:07.659Z
---

You can deploy recommendation widgets using Google Tag Manager (GTM). This method is useful for adding widgets without modifying your site's codebase.

## Prerequisites

- The `ip.js` tracking script must be installed on your site, either directly or through a separate GTM tag that fires before the widget tag.

## Deploy widget tag

1. **Create a tag** – Create a new tag in your GTM workspace.
2. **Configure the tag** – Complete the following:
   - Choose **Custom HTML** as the tag type.
   - Paste the widget script code into the HTML field. Replace `YOUR_DELIVERY_KEY` with your actual key.

```html
<script class="idio-recommendations" type="text/x-mustache" data-api-key="YOUR_DELIVERY_KEY">
   {{#content}}
   <div class="idio-recommendation">
       {{#main_image_url}}
           <a href="{{link_url}}"><img src="{{main_image_url}}?w=150&h=150" class="image" /></a>
       {{/main_image_url}}
       <h3><a href="{{link_url}}">{{title}}</a></h3>
       <p>
           {{abstract}}
           <a href="{{link_url}}">Read more...</a>
       </p>
   </div>
   {{/content}}
</script>
```

3. **Configure the trigger** – Set the trigger to fire on the specific pages where you want the widget to display. You can use a **Page View** trigger with conditions based on the **Page Path**.
4. **Save and publish** – Save your tag and publish the GTM container.
