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

JS Tracking: Improve documentation for multiple Piwik server tracking #10883

Closed
gkannan21 opened this issue Nov 20, 2016 · 8 comments
Closed
Labels
answered For when a question was asked and we referred to forum or answered it. c: Website matomo.org For issues related to our matomo.org website.

Comments

@gkannan21
Copy link

Hi ,
I need to know more for the following,

1.how to track the website data to multiple piwik server in version 2.17.0 , can anyone show me the sample tracking code for tracking my website data in to multiple piwik server and also for multiple website date into single website id in same piwik server.

i need for 2.17.0 version java tracking code not earlier code.

2.difference between domain,subdomains and sub directories,multiple piwik tracker.

Actually, my website video site xxx.com with many users page like "xxx.com/username1""xxx.com/username2" like its going
i need to track in piwik for each and every username created separately in piwik server.
Also i need to track all user page in single piwik site id in another piwik server or same piwik server.

Please advice any idea.
if you have any confusion please reply.

Thanks
KannanG

@tsteur
Copy link
Member

tsteur commented Nov 20, 2016

@gkannan21
Copy link
Author

Hi ,

I already seen that document , but its not clear where to add and how to add this code in my website.for version 2.17.0
for my 3 question which one i have to use multiple tracker or subdirectories
Thanks for your reply

@gkannan21
Copy link
Author

any one please advice

@mattab
Copy link
Member

mattab commented Dec 6, 2016

I already seen that document , but its not clear where to add and how to add this code in my website.for version 2.17.0

@gkannan21 what is not clear in the developer guide? maybe we can improve it there

@mattab mattab added this to the Backlog (Help wanted) milestone Dec 6, 2016
@mattab mattab changed the title Multiple Piwik server tracking JS Tracking: Improve documentation for multiple Piwik server tracking Dec 6, 2016
@mattab mattab added the c: Website matomo.org For issues related to our matomo.org website. label Dec 6, 2016
@tsteur
Copy link
Member

tsteur commented Dec 6, 2016

The guide pretty much doesn't cover this topic at all currently, unless you kind of want to track same data into different servers. A standalone page for this would be great eventually

@gkannan21
Copy link
Author

Above document clear for 2.16.0 before version,but not clear for recent versions 3.0.
it just given code like this

<script type="text/javascript"> window.piwikAsyncInit = function () { try { var piwikTracker = Piwik.getTracker("http://URL_1/piwik.php", 1); piwikTracker.trackPageView(); var piwik2 = Piwik.getTracker("http://URL_2/piwik.php", 4); piwik2.trackPageView(); } catch( err ) {} }; </script>

But i dnt know where i have to include this code,if i add this code below piwik java code its not working .
iam ecpecting full code sample code for version 3.0 like below.

<script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//piwik.example.org/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '1']); // Add this code below within the Piwik JavaScript tracker code var secondaryTracker = 'https://analytics.example.com'; var secondaryWebsiteId = 77; // Also send all of the tracking data to this other Piwik server, in website ID 77 _paq.push(['addTracker', secondaryTracker, secondaryWebsiteId]); // That's it! 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>

@gkannan21
Copy link
Author

gkannan21 commented Dec 22, 2016

Hi All
Actually this is my java tracing code.
my website is xxx.com/login-form and website id is 81 in piwik website list.

<script type="text/javascript"> var _paq = _paq || []; _paq.push(["setDomains", ["*.xxx.com/login-form"]]); _paq.push(['trackPageView']); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); _paq.push(['enableHeartBeatTimer']); (function() { var u="//xxx.com/piwik/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '81']); 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>


I need to track same website data in another website id in same piwik server

for example website id in 59.same piwik server.

iam using 3.0 piwik version.

Also i need to know track same website data in to another piwik server someother website id

for example piwil server name yyy.com/piwik and website id is 2.

Please give me the exact java script code (like code available between 2 lines.for above my requirement.

Please dont refer this link for me "https://github.com/piwik/developer-documentation/pull/132/files?short_path=60f3612#diff-60f3612107814f4dba4f161a21efa02e"

Already i followed the link.i need exact code for the piwik version 3.0.

Thanks
KannanG

@tsteur
Copy link
Member

tsteur commented Feb 24, 2017

@tsteur tsteur closed this as completed Feb 24, 2017
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Feb 24, 2017
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. c: Website matomo.org For issues related to our matomo.org website.
Projects
None yet
Development

No branches or pull requests

3 participants