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

Cross Domain linking in JavaScript tracking client piwik.js #11243

Merged
merged 14 commits into from Jan 22, 2017
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jan 20, 2017

To make feature work one has to

  1. Configure setDomains()
  2. Enable enableCrossDomainLinking()

If link is going to different domain that belongs to same Piwik website, it will add two URL parameters:

pk_vid=900d0d1eb6714aa41484879482d2bb13

Where we have 1) visitorId (16 char) 2) the current timestamp (10 char) and 3) a hashed combination of userAgent / platform to make sure when a user shares it, the visitorId won't be applied to another user. Timestamp is only valid for 45 seconds, and only works on same browser / platform when same browser features are enabled.

So far it works for clicks and right click open in new window (if this tracking feature is enabled).

It is important to enable "enableCrossDomainLinking" on the target page (different domain) as well.

Backend part is still missing and needs to be implement later.

@mattab can you have a look when you have time?

@tsteur tsteur added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Jan 20, 2017
@tsteur tsteur added this to the 3.0.2 milestone Jan 20, 2017
@tsteur
Copy link
Member Author

tsteur commented Jan 20, 2017

Actually I will be changing it to use only one parameter with then 32 characters and also add more validation so cookies cannot be injected

@tsteur
Copy link
Member Author

tsteur commented Jan 20, 2017

done

@mattab
Copy link
Member

mattab commented Jan 22, 2017

Beautifully done, I'm impressed 🎉

@mattab mattab merged commit ae8a945 into 3.x-dev Jan 22, 2017
@mattab mattab deleted the crossdomain branch January 22, 2017 09:34
@cemdev
Copy link

cemdev commented Jan 22, 2017

This is AMAZING. Such a useful feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants