What do I put into the "Site or app address" field in GTM if I don't want to track only specific hostnames?

In the GTM PiwikPRO tag template, there is a field “Site or app address”. The description says: “You’ll collect data for this site or app. Enter a full URL like https://example.com. You can add more URLs if you track a few sites with the same tracking code. Separate with the enter key. No commas.”

We have so many different subdomains and test platform hostnames, I cannot enter them all…
What happens if I leave this field empty?

I thought the field to restrict the tracking to certain domains is in the Admin → Basic Info → Collect data only from known sites. So I don’t know why this field in GTM is needed at all? Does it have any impact if I miss some subdomains?

Hello @loldenburg

Keep in mind that the GTM tag template is only for our Analytics tag. Because of that, it’s only responsible for firing our Analytics code from GTM. To take advantage of the settings in Administration, you’d need to install our full container code (our Tag Manager) according to the guide here: Google Tag Manager: install a container (with a tracking code) | Piwik PRO help center

Thanks. I know it is limited, but it is super ugly and bad for performance to use that much Custom HTML, so I really want to use the tag template. Piwik Pro should invest some time into making this template fully functional. I don’t need the Consent oder Tag Manager, so having only Analytics is fine, but I need the template to do basic things, like setting Custom Dimensions etc…

Still, would be great if my question could be answered. Do I really need to fill in all the possible Site names in GTM? Because there IS a field in the GTM template for Sites, and I just want to track no matter which hostname the user is on, so ideally I would like to keep this empty, not having to specify all possible hostnames that will ever be tracked.

@loldenburg I don’t usually use the GTM template for Piwik’s Analytics suite, but if you need to set custom dimensions, you can look at their API developers’ documentation.

For example, you might consider using a custom HTML tag type to set custom dimensions, here is a link on how to do that

I personally don’t know how event tracking works in the Piwik GTM template, but I think that you might end up looking at the dev resources on how to do it.

@loldenburg if the template makes it possible to keep it empty, go for it. It won’t affect tracking for the default configuration (collect data only from known domains is disabled by default). If it requires you to fill it in, just specify one of tracked domains and it should work fine.

These settings matter mainly if you are to set up cross-domain tracking later on.

@kuba Thanks, but GTM says: “Please enter one or more full URLs”
So your template does not allow me to leave the sites empty. I mean I can easily hack the template, but I prefer to do that only in extreme cases.

In any case, please confirm:

  1. Whatever is in the “Sites” field in GTM does not matter because it is overwritten if the Admin setting “collect data only from known domains” is disabled.
  2. Or is the Sites field in GTM only for cross-domain tracking and has nothing to do with the Admin setting “collect data only from known domains”.

Just trying to understand the mechanics here.

Thanks, I do know how to set Custom Dimensions and I am doing it already and massively. What I am saying is that it is not really state of the art to do this via Custom HTML because that is not good for performance. And that it looks unprofessional if Piwik Pro does not offer such basic functionality in their Tag template. So I am begging Piwik Pro to enhance their GTM template instead of making people use Custom HTML.

Hi,

even if it is not added to the main branch, maybe you can use my fork for that template on Github in the meantime. It allows an empty value in the “Site or app address” field since I just read this thread and the confirmation that this will not break things ;).

The fork is not perfect but allows to configure and send different hit types and includes a setting to “Enable Strict Privacy Mode” (or disable it) by using a variable instead of a checkbox. I added this in order to optionally comply with TTDSG according to the current consent choice without having to use two different tags.

hopefully this enhanced version will get a chance to make it into the official repo but I guess there are (understandably) so much other things to work on right now that using a “disconnected” and manually imported tag template is a valid option.

best,
Markus

2 Likes

After digging a bit deeper I can say that it’s true. For the “known sites” option our tracker relies only on what was added via UI.

(updated: I had to put spaces into the links so your forum allowed me to answer…)

Great, thanks. Really appreciate your help. If it is only needed for cross-MAIN-domain tracking, the field should be optional.

Another improvement of the GTM template would be: Make it clear that this “sites” field has nothing to do with the Sites field in the Admin settings, and with an info (ideally example) on what should be filled in there.

And sorry for pestering you, but I am still not 100% sure though what I should fill in now, because I have to put sth in there, and I don’t want this to break the cookie logic across subdomains.

Afai understand, if I want cross-MAIN-domain tracking, I have to fill in the the field with the main domains, e.g. https :// example .com/ and [https :// otherexample .com], but not subdomains, so https :// subdomain .example .com/. Correct?

If all my tracking is on main domains and subdomains of example.com, is it enough to set https :// example .com/?

Wow, that’s awesome, but why am I no longer surprised by you? :smiley: I will take a look at that! (actually had not seen your post until I had written my last answer to Kuba, sorry!)

When it comes to the original template, putting there just one of the domains won’t break things. As for the subdomains, we can rely solely on the wildcard cookie domain (*.example.com).

Thanks @mbaersch for your contributions. We’re currently scaling the integrations team and hope to merge new features into the main branch next year.

" When it comes to the original template, putting there just one of the domains won’t break things. As for the subdomains, we can rely solely on the wildcard cookie domain (*.example .com )."

→ It requires a “full URL”:
“You’ll collect data for this site or app. Enter a full URL like https :// example .com. You can add more URLs if you track a few sites with the same tracking code. Separate with the enter key. No commas.”

So I will enter https :// example .com. If I misunderstood you, please let me know.

Later this week I will check out Markus’s template. As I have already built my own Custom Dimensions logic etc., this will take some more time as I will have to probable remove / change some other places.

(And please deactivate the annoying forum restrictions like "you cannot post a link to that host (example .com?)? Takes me like 10 minutes to post sth here because I need redact all links 5 times before I can post it…

It’s all fine. My 2nd comment was on the other option:

As for posting the links, your trust level has increased, so it shouldn’t be an issue (if I understand this forums mechanism correctly).

1 Like