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

The method setTrackerUrl is registered more than once in "_paq" variable #15

Closed
gtlt opened this issue Mar 24, 2017 · 4 comments
Closed

Comments

@gtlt
Copy link

gtlt commented Mar 24, 2017

Hi,

I'm experiencing the following error in Chrome / Opera / Vivaldi but not in Firefox :
The method setTrackerUrl is registered more than once in "_paq" variable

In Firefox <head> contains only one occurrence of :

<head>
<script type="text/javascript" async="" defer="" src="https://stats.mydomain.com/kiwi.js"></script>
...
</head>

when in others browser I have it twice :

<head>
<script type="text/javascript" async="" defer="" src="https://stats.mydomain.com/kiwi.js"></script>
...
<script type="text/javascript" async="async" defer="defer" src="https://stats.mydomain.com/kiwi.js"></script>
</head>

Here is a curl output (no js applied) of a page :

...
<script type="text/x-magento-init">
{"*":{"Henhed_Piwik\/js\/tracker":{"scriptUrl":"https:\/\/stats.mydomain.com\/kiwi.js","trackerUrl":"https:\/\/stats.mydomain.com\/kiwi.php","siteId":1,"actions":[["enableLinkTracking",true],["setLinkTrackingTimer",500],["trackPageView"]]$
<script type="text/javascript">
(function (w, d) {
    w._paq = w._paq || [];
    w._paq.push(['setTrackerUrl', 'https://stats.mydomain.com/kiwi.php']);
    w._paq.push(['setSiteId', 1]);
    w._paq.push(['setRequestMethod', 'POST']);
    var g = d.createElement('script'),
        s = d.getElementsByTagName('script')[0];
    g.type = 'text/javascript';
    g.async = true;
    g.defer = true;
    g.src = 'https://stats.mydomain.co/kiwi.js';
    s.parentNode.insertBefore(g, s);
})(window, document);
</script>
<noscript>
    <p>
        <img src="https://stats.mydomain.com/kiwi.php?idsite=1&rec=1&url=https%3A%2F%2Fwww.mydomain.com%2F"
             style="border: 0;"
             alt="" />
    </p>
</noscript>
...

I'm using the js/php renaming, but the same error occurs with standard piwik too.

Are you able to reproduce the issue ?

@henkelund
Copy link
Collaborator

Hi,

Do you have a fresh install of 1.3.0 or did you upgrade from an earlier version? I'm asking because it could be caused by the browser caching the previous version of tracker.js.

@gtlt
Copy link
Author

gtlt commented Mar 24, 2017

It is a fresh 1.3.0 install. Maybe it is related to my varnish/nginx config, I will try to investiguate

@gtlt
Copy link
Author

gtlt commented Mar 24, 2017

Well in fact it is related to browser cache, CRTL+F5 generate the msg on blink browsers. And I'm constantly using it... Sorry for the wrong issue :)

@gtlt gtlt closed this as completed Mar 24, 2017
@henkelund
Copy link
Collaborator

No problem, glad you solved it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants