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

piwik.js: cross domain POST and automatically setRequestMethod('POST') when request > 2K #2321

Closed
robocoder opened this issue Apr 16, 2011 · 15 comments · Fixed by #11201
Closed
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@robocoder
Copy link
Contributor

GA starting doing this earlier this month.

We've had setRequestMethod() since Oct 2010, but this is an increasing necessity with the increase in size of tracking requests (e.g., attributeable to first party cookies and custom variables).

@robocoder
Copy link
Contributor Author

(In [4483]) fixes #2321

@mattab
Copy link
Member

mattab commented Apr 17, 2011

setRequestMethod('POST') will only work when piwik server is on the same domain as the request, right? so vote for revert since otherwise it will break all tracking requests when piwik site is tracked on different domain as piwik server.

@robocoder
Copy link
Contributor Author

(In [4486]) refs #2321 - revert r4483

@mattab
Copy link
Member

mattab commented Apr 17, 2011

Thanks - I think the proper solution involves some interesting magic such as POSTing to Iframes or cross posting xml http requests (none of which would work on all browsers so a combination of techniques is required)

@robocoder
Copy link
Contributor Author

(In [4487]) refs #2321 - implement Cross-Origin Resource Sharing per W3C draft (supported by FF3.5, IE8, and latest versions of Safari and Chrome)

@robocoder
Copy link
Contributor Author

(In [4492]) refs #2321 - fix unit test for feature freeze

@robocoder
Copy link
Contributor Author

(In [4493]) refs #2321 - increase wait time on unit tests as tracking tests sometimes takes longer than expected

@robocoder
Copy link
Contributor Author

(In [4503]) refs #2321 - fallback to getImage() if XDR fails

@mattab
Copy link
Member

mattab commented May 20, 2011

(In [4731]) Refs #2432 Increasing Custom Variable truncation limit to 100 chars (name and value each allowed 100 chars long) + tests
This is to allow more safety margin in tracking Ecommerce product name views refs #898
Note: we do really need to work on Refs #2321 soon ;)

@robocoder
Copy link
Contributor Author

Note: reverted [4487] in r6210 because Microsoft's implementation of XDR is broken (i.e., it doesn't follow the CORS spec). We might re-introduce it later, but would require browser detection.

@robocoder
Copy link
Contributor Author

(In [6214]) refs #3112, refs #2321 - XMLHttpRequest Level 2 spec (draft) supports CORS; clean up comments

  • Safari 4+
  • Firefox 3.5+
  • Chrome 2+
  • IE10
  • Opera 12 (CORS support enabled in Presto/2.10.232)

So, we won't restore support for IE's broken XDomainRequest, ever. (Tracker.php already implements the CORS response header.)

@asafyish
Copy link

asafyish commented Jan 5, 2015

We are tracking some pages with unicode text, so when it's encoded it's gets really long (each character is encoded to 4 characters). our get requests length is around 2500 which is way over the 2000 limit. Is there a solution ? I was thinking about using setCustomRequestProcessing and removing some parameters that we don't care about.

@mattab mattab modified the milestones: Mid term, Long term Jan 5, 2015
@ashleyyang0610
Copy link

I also got 414 (Request-URI Too Large) error when my event value is too long in trackEvent method.
In this case, I want to record complete RESTful APIs info such as name, body.
It's not a good long-term solution to modify piwik web server request header size since I can't estimate the length of body for each request.
I think it's what I want if it automatically setRequestMethod('POST') when request > 2K, would you please add this as soon as possible or give me some suggestion for fixing this error message?
Thanks.

@mattab
Copy link
Member

mattab commented Sep 26, 2016

would you please add this as soon as possible or give me some suggestion for fixing this error message?

We welcome Pull requests 👍 http://developer.piwik.org/guides/contributing-to-piwik-core

@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
@tsteur
Copy link
Member

tsteur commented Jan 17, 2017

I might be working on this one

@tsteur tsteur self-assigned this Jan 17, 2017
mattab pushed a commit that referenced this issue Jan 17, 2017
* fixes #2321 when tracking request is > 2000 char, prefer POST

* Fix jslint
@mattab mattab modified the milestones: Backlog (Help wanted), 3.0.2 Jan 17, 2017
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 a pull request may close this issue.

5 participants