Navigation Menu

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

Download tracking problem with multiple Piwik Trackers #3409

Closed
anonymous-matomo-user opened this issue Sep 26, 2012 · 4 comments
Closed

Download tracking problem with multiple Piwik Trackers #3409

anonymous-matomo-user opened this issue Sep 26, 2012 · 4 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. worksforme The issue cannot be reproduced and things work as intended.
Milestone

Comments

@anonymous-matomo-user
Copy link

When using two trackers on the same page, visits are being logged fine at both projects, but downloads are only tracked at one.

How to reproduce:
e.g. this code is being used (siteId 7 and 1):

var _paq = _paq || [];
(function(){
    var u=(("https:" == document.location.protocol) ? "https://URL/" : "http://URL/");
    _paq.push(['setSiteId', 7]);
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);

    _paq.push(['setSiteId', 1]);
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);

    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+'piwik.js';
        s.parentNode.insertBefore(g,s);
})();

When clicking a download (and looking at the network http requests), Piwik sends only one request instead of two:

 http://URL/piwik.php?download=<MYLINK>&idsite=1&... ```


**Expected behaviour:**
...would be another request with siteId 7.
@robocoder
Copy link
Contributor

No, this is the expected behaviour. You're only using one tracker.

With the async method, _paq is a proxy for an internal tracker.

@anonymous-matomo-user
Copy link
Author

Ok, sorry maybe the "behaviour" would work with just one request (coming from _paq, don't know the technical details), but it doesn't change the fact that downloads are only tracked at one project, not both, as you'd expect.

Whereas visitors are being logged at both...isn't that contradictory? Stats are incomplete that way.

@robocoder
Copy link
Contributor

When you call setSiteId(), you're changing the tracker config. It no longer knows about site 7 when it processes the click.

This is the intended behaviour/design.

@anonymous-matomo-user
Copy link
Author

ok, thanks

@anonymous-matomo-user anonymous-matomo-user added this to the 1.9 -- Piwik 1.9 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

3 participants