Step-by-step guide
Two paths, and there are no others
No matter which system you use, it always comes down to one of these two options:
| Path | Who it is for | What you do |
|---|---|---|
| 1. Through a feature for custom code | Website builders, shop systems, content management systems | You look through the settings for a field where you are allowed to paste code. The rest of this guide helps you with the search. |
| Straight in the source code | Hand built sites, your own server, access by FTP | You open the HTML file and place the code by hand. We have a separate guide for that: Add the tracking code to an HTML document. |
If both paths are open to you, take the first one. It is faster and it survives an update of your system.
Where to find the feature
Now comes the part that costs the most nerves. The feature is called something different almost everywhere. So do not hunt for one specific word, hunt for one of these terms. One of them fits almost every time.
| What to look for in the menu | Typical names |
|---|---|
| The area | Settings, Advanced, Development, Integrations, Tools |
| The feature itself | Custom Code, Code Injection, Scripts, Snippets, Tracking, Tracking Tools, Analytics, SEO |
| The field | Head Code, Header, Custom head Content, Additional Head HTML |
Two of these terms surprise a lot of people. "SEO" is a common hiding place, even though search engines have nothing to do with your measurement. And "Analytics" sometimes leads only to a field for a Google number, not to a free code field. Make sure you have a large, empty text box in front of you. That is the only place our code fits.
Head, Body or Footer
Many systems offer you several fields and ask where the code should end up. That choice decides whether you count all your visitors or only some of them. Stick to this order:
| Rank | Area | Why |
|---|---|---|
| 1st choice | Head, also called Header | The code loads before the visitor sees anything at all. Even very short visits are recorded. Always take this one if it exists. |
| 2nd choice | Body, start, also called Body start | A bit later, but still early enough for usable numbers. |
| 3rd choice | Footer, end of body | Only as a last resort, if your system offers nothing else. Anyone who leaves the page quickly does not get counted here. |
Only one single field with no choice at all? Then just use it. In that case your system already made the decision for you, usually in favor of the head section.
And in case you are wondering why this matters so much: the difference never shows up anywhere. You see visitors, the numbers look plausible, and a chunk is missing anyway. So better to think for two seconds now than to puzzle over it later.
Pasting in the code and saving
Once you have found the spot, the rest is quickly told:
- Grab your code under Tracking Code with a click on "Copy". Your address is already filled in.
- Paste it into the field.
- Save.
- Publish your website if your system requires that extra step.
If your system complains: some fields only accept pure code and reject everything else. If your system shows a red message, delete the two comment lines <!-- Trustlytics --> and <!-- End Trustlytics Code -->. The only thing allowed to stay is the line that starts with <script.
Checking
Since we cannot show you screenshots for your system, this step matters more than usual here. It takes two minutes and tells you for certain whether it worked.
The quick way:
- Open your website in a new browser window.
- Click through a few pages.
- Switch to the Real-time report in Trustlytics.
- Within a few seconds, your own visit should show up there.
If something is listed there, everything is installed correctly.
The thorough way, in case nothing appears: check whether the code even made it onto your page.
- Open your website and press Ctrl + U (on a Mac Cmd + Alt + U). The source code opens.
- Press Ctrl + F (Mac: Cmd + F) and search for trustlytics.
If the line turns up, the code is sitting right and the problem is somewhere else. If nothing turns up, your system did not deliver the code. The next section helps with that.
When nothing gets counted
Six causes cover almost every case, and they are the same in every system:
| Cause | What to do |
|---|---|
| Not published | The single most common case. Many systems separate your working version from the version on the web. Saving alone is not enough there. |
| Not saved | Open the field again. If it is empty, your entry was not accepted. Paste it again, and this time watch for a confirmation. |
| Wrong area | If the code ended up in the footer, short visits are missing from your numbers. Switch to head, if your system offers that. |
| One page instead of all of them | Some systems offer custom code both for the whole website and for individual pages. For the measurement, you need the setting that applies to all pages. |
| Only tested the preview | Open your website at its proper address, not through the editor. |
| Wrong address registered | The code only works on the website listed in your Trustlytics account. Check that under Website. A common trap: you are measuring your provider's free address, but your visitors arrive through your own domain. |
When your system offers nothing at all
They exist, the cases where there is simply no field for custom code to be found. Usually one of these three reasons is behind it:
- Free plan. Many providers only unlock custom code on a paid plan. A look at your contract overview settles that faster than any hunt through the menus.
- Missing permissions. If you work with limited rights in somebody else's account, areas like this are often hidden. Ask the person who owns the account.
- The system does not allow it. Some closed platforms do not permit any outside code at all. Then there is no way around asking your provider.
And the most honest tip to finish with: ask your provider's support. Not about Trustlytics, but like this: "Where can I add my own JavaScript code in the head section of my website?" Everybody there knows that question, and you usually get a clear answer within hours.
Let us know
One request at the end, and we mean it: drop us a line about which system you use. One sentence is enough.
We write our guides based on demand. If several customers report the same system, it goes on the list and gets its own article with screenshots. So your feedback does not just help you, it helps everyone who comes after you.
And if you get stuck somewhere, reach out. We will take a look at your system and tell you where the code belongs.
Common questions
Does Trustlytics really work with every system?
With almost everyone. The only condition is that you are allowed to add custom code somewhere. Whether that happens through a field in the settings or straight in the HTML makes no difference. It only fails on completely closed platforms with no code option at all.
Do I need to know how to code?
No. You copy a finished line and paste it into one spot. There is nothing for you to change about it.
I have several fields to choose from. Which one do I take?
Always the one for the head section, so "Head" or "Header". Only if that does not exist do you fall back on Body or Footer.
Do I have to paste the code into every page individually?
Only if your system has no setting for the whole website. Look for a spot like that first, it saves you a lot of work. And you will not forget a new page later on.
How do I tell whether the code is active on all pages?
Open two or three different pages of your website and check in the Real-Time report whether all of them show up. If one is missing, the code was not delivered there.
Can I break something while pasting it in?
No. Our code does not change your website visually and does not interfere anywhere. And you can delete it again at any time, and then everything is like before.
Will my website get slower because of it?
No. The script is tiny and loads in the background without holding up the rest of your page.
Do my visitors need a cookie banner now?
No. Trustlytics works without cookies. Your visitors do not have to click anything away or confirm anything. If your system comes with a cookie banner, please do not tie our code to consent. Otherwise, you will be missing all the visitors who did not click.