Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page Overlay url on external sites #13060

Closed
tpimpao opened this issue Jun 14, 2018 · 2 comments
Closed

Page Overlay url on external sites #13060

tpimpao opened this issue Jun 14, 2018 · 2 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@tpimpao
Copy link

tpimpao commented Jun 14, 2018

Hi,
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?

Thanks,
TP

@tpimpao
Copy link
Author

tpimpao commented Jun 15, 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 mod_proxy 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]);
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (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);
      })();
</script> 

Now i have an error:

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

Any ideia?

Thanks,
TP

@mattab
Copy link
Member

mattab commented Feb 13, 2020

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!

@mattab mattab closed this as completed Feb 13, 2020
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

1 participant