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

Provide a function to safely submit logs from within Javascript functions #626

Closed
anonymous-matomo-user opened this issue Mar 25, 2009 · 2 comments
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.

Comments

@anonymous-matomo-user
Copy link

Please provide a function to safely log requests from within javascript functions which modify the DOM.

Currently, when you try to log a visit from within a Javascript function which generates HTML output, calling piwik_log results in a document.writeln which apparently clobbers “large parts” of the DOM.

We worked around this issue by using something like

```
var imgsrc = _pk_getUrlLog(‘pix/’ + io.filename, 5, pkBaseURL + ‘piwik.php’);
box.innerHTML = ‘’imgsrc+’" border="0">’;
```

in the Javascript which we use to dynamically generate our pages, but this is Bad Practice™.

@robocoder
Copy link
Contributor

Thanks. This is a duplicate of #355. The new piwik.js (now in testing) no longer uses document.write.

@anonymous-matomo-user
Copy link
Author

Sorry for the duplicate, overlooked it in the list :/.

Thanks for Piwik and keep up the good work!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

2 participants