matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.74k stars 2.63k forks source link

Functions to set campaign and keyword names in Javascript tracking API #3374

Open anonymous-matomo-user opened 12 years ago

anonymous-matomo-user commented 12 years ago

Related forum thread: http://forum.piwik.org/read.php?3,93280

Plase, it would be very useful if campaign name and campaign keywords could be set using Javascript API functions. Maybe two new functions could be created, named setCampaignName and setCampaignKeyword which internally would add _rcn and _rck parameters to the call to piwik.php.

Thanks Keywords: campaign

mattab commented 11 years ago

You can do a similar thing with:

tracker.setCustomUrl( document.URL + "?&_rcn=TestName&_rck=TestKeyword" );
anonymous-matomo-user commented 11 years ago

Yes, I know, thanks. In fact it's what I'm doing (as I said in the forum thread), but it would be cleaner not to alter the original url (my humble opinion).