Incorrectly configuring a tenant's custom.js file can break the tenant. Antidot cannot be held responsible for any problems that may occur for this reason.
The custom.js file contains some additional JavaScript code that is injected at the bottom of Fluid Topics pages. For instance, this file is used to add traffic trackers to Fluid Topics such as Google Analytics, Marketo, Matomo, and so on.
The following lines show an example of custom.js to use Matomo:
if (window.location.host == "customer.fluidtopics.net") {
/* Matomo*/
var _paq = _paq || [];
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") "://analytics.fluidtopics.net/";
_paq.push(["setTrackerUrl", u+"matomo.php"]);
_paq.push(["setSiteId", "4"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
g.defer=true; g.async=true; g.src=u+"matomo.js";µ
s.parentNode.insertBefore(g,s);
})();
/* End Matomo Code */
}
Once implemented, it is possible to use Matomo to consult analytics about Fluid Topics:
user@host:/usr/local/afs7/conf$ tree
.
└── conf.xml
user@host:/usr/local/afs7/Fluid-Topics/conf$ tree
.
├── -
│ ├── mongo.conf.json
│ └── ws.conf.json
└── $TENANT_ID
├── conf.json
├── header.vm
├── pdf_templates
│ └── $TEMPLATE_DIRECTORY
│ └── pdf-template.vm
├── public
│ ├── custom.js
│ └── custom.less
└── vhost.conf.json