Any site you can add a script tag to connects to Universally through the Any Website project type. You add one line to the <head> of every page, then pick how translated pages are served: in the visitor's browser at the same addresses (JavaScript), or on a subdomain per language such as fr.example.com (Subdomain). The line is needed in both modes.
Before you start
- Access to the
<head>of every page. In a website builder that is the head code box in settings. In your own files it is the template every page shares. - The Owner or Admin role in your Universally workspace, to create the project and see its snippet. Editors see "Ask a project admin for this project's installation snippet." instead of the line.
- For Subdomain mode, access to your domain's DNS. Each language needs three records.
Create the project
- Start a new project. Under Select Your Technology, pick Any Website.
- Fill in Domain, the fully qualified domain your site is served on, such as
example.com. If the domain does not resolve yet, you see a warning, and you can still continue. - Fill in Project Name, check Source Language (English (US) by default), and click Next.
Choose how translated pages are served
The Setup Instructions screen asks "How should translated pages be served?" and offers these cards:
| Card | Example | What the card says |
|---|---|---|
| JavaScript | website.com |
Quickest to install, no DNS change, works on any platform. No search-engine visibility, and public pages only. |
| Subdomain | fr.website.com |
Safe and quick. Never touches your live traffic and works on any registrar. |
| Domain | Disabled, marked Coming Soon. |
No card is picked for you, and Continue stays disabled until you choose. Your site keeps running exactly as it is: nothing changes until the final step, and you decide when that happens.
Pick JavaScript if you want the fastest setup and do not need translated pages in search results. See JavaScript serving mode for what it translates and what it does not. Pick Subdomain if you want each language on its own address.
A JavaScript project can move to subdomains later from its Setup page. A Subdomain project cannot move back to JavaScript.
Add the snippet
The Add the snippet step draws your line inside an example page. The dashboard fills in your project's key:
<script src="https://scripts.universally.com/p/YOUR_PUBLIC_KEY/s.js" async></script>
- Click Copy line. It copies only the script tag, and the button changes to Copied.
- Paste it anywhere between the
<head>and</head>tags, on every page. In a website builder, use the site-wide head code box in settings. In your own files, use the template every page shares. - Save, and publish the change.
In JavaScript mode the line renders the language switcher and translates each page. In Subdomain mode it renders the switcher that links your language subdomains. The Mark as complete buttons on the screen are stored in your browser and gate nothing.
Publish and check the connection
Saved is not live on most builders, and the check only sees what is published.
- Publish your site.
- Click Check connection.
The check loads your home page and looks for the line. Found it means the line is on your domain, it belongs to this project, and there is nothing else to install. Nothing changes for your visitors yet, because your site starts serving translations once you add languages.
Continue and I will do this later both move on, and nothing waits on the check. The line stays on the project's Setup page, under The line your site needs.
Add languages in JavaScript mode
- On Add Languages, answer "Which languages do you want to translate into?" with at least one target language.
- Click Finish. It stays disabled until the project has a language.
The language dialog still shows URL Format, but the value is unused in JavaScript mode because your URLs never change. See Add and remove languages.
Add languages in Subdomain mode
The languages step shows the Languages card instead.
- Click Add subdomain for language.
- In Add Target Language, pick Language and Region, then a Subdomain format. French with Language Code on
example.combecomesfr.example.com. - Add the three DNS records the row shows at whoever manages your domain, and wait for the row to read Live.
The records, their statuses and the checks are covered in Language subdomains.
Verify it worked
- JavaScript mode: open your site in a private window. The switcher sits in the bottom-right corner. Pick a language and the page reloads in it at the same address.
- Subdomain mode: open
https://fr.example.com/once its row is Live. It serves your site translated, and the switcher links the language hostnames.
If it does not work
- We loaded your domain but the line was not in the page: the change was not saved or published, a host or CDN still serves a cached copy, or the line went somewhere other than the
<head>. The check only looks at your home page. - We could not load your domain at all: the site is offline, behind a login, blocking the request, or the domain on the project is wrong.
- That line belongs to a different project: replace it with the line on this project's Setup page, then check again.
- A language subdomain stays on Verifying or Failed: see Language subdomains.
More cases are in Translations are not appearing.