@tpimpao opened this Issue on June 14th 2018

My environment setup is:
Internally URL (http://internalaccess.sample.com): Full access do matomo
External URL (http://externalaccess.sample.com): Only access to piwik.php and piwik.js files.

Using Page Overlay in internal site, the matomo try to use the external url to access to Overlay plugin and API. This not work because externally i only expose the piwik.php and piwik.js files.

There is any way to force matomo to use only the internal url?


@tpimpao commented on June 15th 2018

Hi again.
So, reading the https://matomo.org/docs/page-overlay/ page:

_Page Overlay tries to load scripts and data from the URL you pass to the Matomo (Piwik) tracker. If you have a restrictive modproxy setup or there’s another reason why this doesn’t work, use the method setAPIUrl(apiUrl) of the Matomo tracker to let it know from which URL it should load the scripts and the data. The parameter apiUrl has to point to the root directory of piwik, e.g. http://piwik.example.org/ or https://example.org/piwik/. The call to setAPIUrl has to be made before calling trackPageView.

I set the snipped:

<script type="text/javascript">
        var _paq = _paq || [];
        var apiUrl = "http://internalaccess.sample.com/";
        /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
      _paq.push(["setAPIUrl", apiUrl]);
      (function() {
        var u="//externalaccess.sample.com";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', '23']);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
        g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);

Now i have an error:

Uncaught ReferenceError: Piwik_Overlay_Client is not defined
at HTMLScriptElement. (piwik.js:41)

Any ideia?


@mattab commented on February 13th 2020 Member

Thanks for contributing to this issue. As it has been a few months since the last activity and we believe this is likely not an issue anymore, we will now close this. If that's not the case, please do feel free to either reopen this issue or open a new one. We will gladly take a look again!

This Issue was closed on February 13th 2020
Powered by GitHub Issue Mirror