WP-Piwik won’t allow to integrate PHP code by default, because this may cause a lot of security vulnerabilities. Anyway, I will check if it makes sense to add this (enabling PHP or (favored) your changes to the code) as option, so you don’t have to modify all your themese.
So you want to add the page name (as action name) and the URL to your noscript code. Can you please explain why you want to do this (at least the URL should be identified by the tracking pixel itself, shouldn’t it?) & may this be helpful feature for other users, too? Thx!
Thread Starter
safidy
(@safidy)
Hi,
Thank you for your response.
The idea is not to send php in piwik API, but :
– let the server (wordpress) to render the inserted php code, the result won’t contain php anymore.
– then send it via piwik API.
eg. :
<noscript><img src=”//41.77.23.82:8056/kiwip-inh/piwik.php?idsite=2&rec=1&<?php echo $_SERVER[‘REQUEST_URI’]?>” style=”border:0;” alt=”” /></noscript>
<?php echo $_SERVER[‘REQUEST_URI’]?> will return something like “en/folder/my_current_page_name” (and there are lots of pages)
That will give us an idea about how to send dynamic variables defined in this piwik API (http://developer.piwik.org/api-reference/tracking-api).
I mean, action_name & url are justs examples. But many users will want to track every variables as possible (lang, res, link, …)
Why do we want to do this :
Because many of our end users have “very simple basic phones” that don’t have javascript? And one of the biggest value of the project is “data”.
May this be helpful feature for other users too :
1) I think yes, because even devices support javascript, many users can “disable” it (especially for mobile users).
2) More MNO (mobile network operators) will interst to the plugin if it can give them many info about their subscribers without JS.
A global study gives 1.5% users disable JS (Computer + featured mobile device + simple mobile devices + …)
But if our targets are “very simple devices”, it will be more significant (an estimation of more than 60% are disabled)
Thank you for your understanding
To keep the WP-Piwik interface as simple as possible, this won’t be part of the WP-Piwik settings.
Anyway, WP-Piwik will offer an interface to handle such changes programmatically, e.g., this will allow you to do such changes within a little WP plugin, function.php, etc.
I hope this will help. You can get more information about the progress here: https://github.com/braekling/WP-Piwik/issues/19