---
title: Install Smartcat with GTM or Custom Code | Smartcat
description: Install the website translation snippet through head code or Google Tag Manager. Follow platform-specific steps and troubleshoot scope, consent, and navigation.
canonical: https://www.smartcat.com/website-translator/install-with-google-tag-manager/
language: en
updated: 2026-11-16
---

# Install Smartcat with GTM or Custom Code | Smartcat

## Install Smartcat Website Translator with custom code or Google Tag Manager

Use the installation route your website actually supports: a site-wide head-code field, your application’s shared layout, or a web GTM container that can run the required tag. Start with the snippet generated for your Smartcat website project.

An embed box, an analytics ID field, and a document head are different things. Choose the correct installation surface before adding code.

Secondary link: Website Translator — [https://www.smartcat.com/website-translator/](https://www.smartcat.com/website-translator/)

- [Start free trial](https://smartcat.com/sign-up)

## Before you install

Create a website translation project, enter the published URL, choose source and target languages, and review the translated preview. Select the languages you are ready to publish.

Use the project-generated snippet rather than copying an example from another site. Keep a record of the installation location so a theme replacement or frontend rebuild does not silently remove it.

## Method A: install in the site’s head

### Open the supported global code setting

Use the website builder’s head-code field or the application’s shared layout. For site-wide translation, do not place the snippet in a content block that appears only on one page.

### Add the snippet and publish the site change

Paste the generated code in the required format. Some settings accept complete HTML script tags; JavaScript-only fields do not. Save, republish or deploy as required, and clear caches that still serve the previous HTML.

### Validate through Smartcat

Return to the website project and use Validate and continue. Publish reviewed languages, then inspect the live site outside the editor session.

## Common installation locations

### WordPress

WPCode → Code Snippets → Header & Footer → Header.

### Shopify

Online Store → Themes → Edit code → layout/theme.liquid, before the closing head tag. Checkout is separate.

### HubSpot

Settings → Content → Pages → the intended domain → Site Header HTML.

### Webflow

Site settings → Custom code → Head code; publish the site.

### Wix and Wix Studio

Dashboard Settings → Custom Code → All pages → Head; published connected domain required.

### Squarespace

Developer Tools → Code Injection → Header on an eligible plan; checkout excluded.

### Magento / Adobe Commerce

Content → Design → Configuration → relevant scope → HTML Head → Scripts and Style Sheets; clear caches.

### Elementor

Custom Code → head with the intended display conditions, or use a WordPress header plugin.

### Divi theme

Theme Options → Integration → enable header code and add the snippet to the head field.

### Square Online

Settings → Tracking Tools → Add new code → head; publish.

### Tilda

Site HEAD code setting; republish affected pages.

### Netlify static HTML

Snippet Injection before the closing head tag. Function and proxy routes are outside that feature.

## Method B: configure a Custom HTML tag in Google Tag Manager

### Use the correct web container

The container must be installed on the published pages you want to translate. A GA4 measurement ID beginning with G- is not a GTM container ID beginning with GTM-.

### Create the translation tag

In GTM, open Tags → New → Tag Configuration → Custom HTML. Paste the Smartcat-generated snippet. Give the tag a descriptive name, such as Smartcat website translation.

### Set the intended trigger and consent behavior

Use an All Pages trigger for the intended site-wide scope, or a narrower trigger where required. Retain the site’s applicable consent conditions. Avoid a duplicate direct-head installation that initializes the same integration twice.

### Preview, then publish the container version

Use Preview on the published URL. Confirm both that the tag fires and that the translated experience works. A fired tag is not, by itself, proof of correct translation. Submit and publish the container version only after the implementation is validated.

## Head code or Tag Manager?

Direct head installation has fewer delivery dependencies. GTM adds the container and its trigger timing, which can mean the translator starts later. Google also notes that Custom HTML code is minified.

Neither route bypasses Content Security Policy. The browser may receive the code and still block its execution or network requests. Use the narrowly required configuration rather than disabling security controls globally.

## Kit: the ID belongs in the landing-page settings

Open the landing page’s Settings → SEO & Analytics → Google Tag Manager and enter the container ID. Configure the Custom HTML tag inside GTM. The landing page and the emails sent after signup are separate content surfaces.

## beehiiv: use the publication website’s tracking settings

Open Website → Builder → Settings → Site settings → Tracking pixels. Add the GTM Container ID, then configure and publish the tag in GTM. A never-published website needs its first publication before these settings appear publicly. Website translation does not translate newsletter email sends.

## Cloudflare Zaraz and code-generated sites

Zaraz Custom HTML is another script-delivery mechanism where the site supports it. Its SPA pageview behavior can fire on URL changes; avoid repeatedly initializing the translator.

For a framework site, use the source layout or supported script configuration. For Mobirise exports, keep the installation in the project or a reproducible export step. Hand edits to generated files can disappear on the next build.

## When neither route is available

An isolated embed cannot grant access to its parent page. That is why a Google Sites embed or a GoDaddy HTML section is not a site-wide translation installation.

Likewise, a custom domain does not automatically grant HTML control over Medium, Notion Sites, or another hosted publishing product. Where arbitrary code or a working GTM route has not been established, use an appropriate content-localization workflow instead of promising a universal script installation.

## Troubleshooting

### The tag never fires

Confirm the correct container is on the page, the tag’s trigger matches, and the container version is published. Preview-only changes are not live changes.

### The tag fires but no translation appears

Inspect the project/domain configuration, browser errors, and the actual snippet. A tag-manager event only proves that GTM attempted to execute the tag.

### Translation appears only after consent

The script may be deliberately deferred by the consent configuration. Review that behavior as part of the site design; do not bypass it to make a demonstration look successful.

### One page works and another does not

Compare domains, templates, page-level overrides, and code scope. A campaign subdomain or checkout can use entirely different page code.

### The old page remains after installation

Clear the relevant website or CDN cache and inspect a fresh published response. An editor setting can be correct while visitors still receive old HTML.

### Navigation changes the page without reloading

Validate a second route and dynamic content states. Avoid creating multiple translator instances on virtual pageviews.

### The content is inside an iframe

Cross-domain frame content is outside the parent script’s access. Install through the embedded service’s own supported mechanism or localize that content separately.

## Frequently asked questions

### Can I translate a website without coding?

Often, if the platform provides the required custom-code setting and your account can use it. A developer is still needed for template, framework, or security changes when the platform does not expose an appropriate setting.

### What is the easiest way to translate a website using AI?

Start with a representative page, review the translation in context, and use the platform’s supported installation route. The shortest route is not useful if it covers only the homepage and misses the customer journey.

### Does Smartcat work with Google Tag Manager?

GTM can deploy third-party Custom HTML tags. The Smartcat snippet still needs validation with your container, timing, consent, and page behavior; a GTM field alone is not a compatibility guarantee.

### Will the script slow my site down?

Any added script introduces work. Measure the actual page and loading behavior; do not assume zero impact or quote a performance improvement without a test.

### Does it work on single-page applications?

Smartcat can detect newly rendered text, but the integration must remain correct through the application’s navigation and rendering lifecycle. Validate those states with the real framework and security settings.

### Does GTM create localized URLs for SEO?

No. Tag delivery and localized URL configuration are separate tasks. Smartcat’s independently crawlable language URLs require its separate SEO configuration.

### Is my platform supported?

Use its specific installation documentation and distinguish website display from native content exchange. If neither arbitrary code nor a validated tag route is available, do not assume support.

Start with a page your customers use

Translate it, review the wording, and validate the complete path visitors follow.

- [Start free trial](https://smartcat.com/sign-up)
