← Back to Trustlytics Sign in
Support Center Settings Tracking code Add the tracking code in Nicepage

Add the tracking code in Nicepage

In Nicepage you only have to paste the tracking code in once. There is a central field for the head section of your website, and whatever sits there automatically applies to every single page of your project. Three minutes of work, then never touch it again.

Two things decide whether it works. First, Nicepage only accepts certain code elements in that field. Second, the change only takes effect once you publish your website again afterward. We will look at both in a moment.

Whichever suits you best:

The video is in the works. Until then, the guide will get you there.

Step-by-step guide

What you need for this

  • Your tracking code. You get it under Tracking code with one click on "Copy".
  • Your Nicepage project. Nicepage comes as a program for your computer and as an online version in the browser. The route is the same in both, only the window looks slightly different.
  • The ability to publish afterward. Without that last step, your change stays sitting in the editor and nothing happens online.

Opening your project

Start Nicepage on your computer or sign in to the online version.

On the left, pick the project you want to measure. All the pages belonging to that project then appear in the main window.

The only thing that matters is picking the right project. Which individual page happens to be open makes no difference, because the setting that follows applies to every page anyway.

Add the tracking code in Nicepage: Opening your project - Trustlytics

Opening the site settings

In the top menu, click (Settings) and choose "Site Settings...".

A separate window opens with a list of sections along the left edge.

Add the tracking code in Nicepage: Site settings - Trustlytics

Choosing the "HTML" section

In that window, pick the "HTML" entry on the left.

Two fields then appear on the right: "Meta Tags" and, below it "Additional Head HTML". The second one is your target. Whatever you write in there, Nicepage puts into the head section of every single page when you publish.

Do not mix it up: there is also a "Google" section next to it with fields for Google Analytics and Tag Manager. That one is meant exclusively for Google. Your Trustlytics code belongs in the HTML field.
Add the tracking code in Nicepage: Choosing the HTML section - Trustlytics
Add the tracking code in Nicepage: Additional Head HTML - Trustlytics

Pasting in the tracking code

Click into the empty "Additional Head HTML" field and paste your tracking code.

Use the copy button in your Trustlytics account. Selecting it by hand, and a character is quickly lost, and then Trustlytics counts nothing at all.

And now the spot where most people get stuck: Nicepage does not allow just any content in this field. Only these elements are permitted:

Allowed in this field What it is
SCRIPT The element your Trustlytics code sits in. That is exactly the one you need.
NOSCRIPT, STYLE, LINK, META, BASE Other technical elements you do not need for Trustlytics.

So now delete <!-- Trustlytics --> and <!-- End Trustlytics Code --> from the "Additional Head HTML" field.

If a red message appears under the field saying that only STYLE, BASE, LINK, META, SCRIPT, and NOSCRIPT are allowed, the culprit is usually a comment line or some extra text you copied along. In that case, clear everything out of the field and paste in only the part that starts with <script and ends with </script>. The message then goes away.

As long as the red message is showing, Nicepage does not accept your input. So the code would be gone the moment you close the window.
Add the tracking code in Nicepage: Pasting in the tracking code - Trustlytics

Saving

At the top of the window, click "Done". The window closes.

Desktop only: after that, click the save icon in the top menu, meaning the little floppy disk. That saves your project. But your change is not online yet.

Add the tracking code in Nicepage: Saving - Trustlytics

Publishing

Now publish your website the way you normally do. Whether you publish straight from Nicepage or export the project and upload it to your server makes no difference. The main thing is that the new version ends up at your real address.

Without this step, nothing runs. Until then, the tracking code only sits in your project on your computer. Online, the old version without the code is still up, and Trustlytics stays empty.
Add the tracking code in Nicepage: Publishing 1 - Trustlytics
Add the tracking code in Nicepage: Publishing 2 - Trustlytics

Checking

Now the moment of truth, and it takes less than two minutes:

  1. Open your website in a new browser window.
  2. Click through a few pages.
  3. Switch to the Real-time report in Trustlytics.
  4. Within a few seconds, your own visit should show up there.

If something is there, everything is installed correctly. If it stays empty, the section below will help.

Do not test in the editor preview. Custom code does not run there.

When nothing gets counted

Five causes cover almost every case:

Cause What to do
Not published yet The most common case. Saving alone is not enough. Publish the project again.
Missed the red message Open the site settings and look at the "Additional Head HTML" field. If it is empty, Nicepage did not accept your input. Paste in only the part from <script to </script>.
Code on a single page instead of in the settings If the code went into an HTML element on one page, Trustlytics only measures that one page. Move it into the site settings.
Only tested the preview Open your website through the real address in your browser, not through the editor preview.
Wrong address registered The code only works on the website listed in your Trustlytics account. Check that under Website.

Common questions

Do I have to paste the code into every page individually?
No. "Additional Head HTML" applies to your entire project. When you publish, Nicepage automatically puts the code into the head section of every page. New pages you create later are included right away too.

Can I use the HTML element on a page instead?
Technically yes, sensibly no. An HTML element only ever belongs to the one page it sits on. You would have to repeat it on every page and remember it for every new one. Through the site settings you handle it exactly once.

Why do I get a red message when I paste in the code?
Nicepage only allows certain elements in this field: STYLE, BASE, LINK, META, SCRIPT, and NOSCRIPT. If you copied a comment line or explanatory text along with it, the field pushes back. Paste in only the part from <script to </script> and it settles down.

Does the code not belong in the "Google" section?
No. That is only for entering ID numbers from Google services, like Analytics or Tag Manager. Trustlytics is not a Google service and needs the HTML field.

The field is missing for me, or I cannot fill it in. What is going on?
Then take a look at your Nicepage plan. Certain features around custom code and custom domains are tied to the plan you booked. If the field is available, it is empty and writable.

Can I remove the code later?
Yes. Open the site settings, clear the "Additional Head HTML" field, click "Done", save, and publish once more. From then on, nothing is measured anymore.

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.

Was this article helpful?