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

Make tracking several site IDs easier to users implementing Piwik using Asynchronous javascript #5049

Closed
mattab opened this issue Apr 28, 2014 · 6 comments
Labels
Bug For errors / faults / flaws.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Apr 28, 2014

It is a common use case to want to track the data in two different websites in Piwik, for example one website for the current website and another one for the "aggregate" websites collecting data across several domains.

In this case here is the recommended practise: http://developer.piwik.org/api-reference/tracking-javascript#multiple-piwik-trackers

Note: When using multiple trackers, you must use the synchronous Javascript tracker object (ie. this will not work with the asynchronous tag).

The goal of this ticket is to remove this bracket from the documentation: '(ie. this will not work with the asynchronous tag)' and make it work when calling .push( 'setSiteId', X ) with X and Y.

This will also resolve a few support issues as this question occurs fairly often!

@tsteur
Copy link
Member

tsteur commented May 5, 2014

Isn't there already a setSiteId method? What exactly is to do here?
Otherwise another solution would be to make it possible to use two trackers when using async

@tsteur
Copy link
Member

tsteur commented May 5, 2014

Found the problem in current implementation, it always calls all setSiteId methods first... So we can either fix this or make two trackers work in async mode by using callback methods

@mattab
Copy link
Member Author

mattab commented May 6, 2014

Maybe proper solution is to throw an exception when setSiteId is pushed more than once?

@tsteur
Copy link
Member

tsteur commented May 13, 2014

In 743ec5b: refs #5049 log to console (if exist) if methods, that are applied first, are registered multiple times. We do not throw an error as this would prevent script execution

@tsteur
Copy link
Member

tsteur commented May 14, 2014

In a9d8533: refs #5049 fix tracker tests, jslint was not as happy as I was

@tsteur
Copy link
Member

tsteur commented May 14, 2014

In 7c2dd6a: refs #5049 added possiblity to use async + multiple piwik trackers

@mattab mattab added this to the 2.3.0 - Piwik 2.3.0 milestone Jul 8, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…pplied first, are registered multiple times. We do not throw an error as this would prevent script execution
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 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.
Projects
None yet
Development

No branches or pull requests

2 participants