add the ability to set the download/outlink tracking class (overriding piwik_download/piwik_link). #549
Labels
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone
With the new updated piwik.js it seems as if it is much harder to be able to change the class for which it tracks as download/outlink/etc
for ex.
old piwik.js had
if( source.className == “piwik_download” )
_pk_link_type = ‘download’;
and thus making it easier to change the class name to be linked to download tracking as I would change “piwik_download” to “myDownloadclass” etc as I had a standard class format for certain links that I wanted to track as download:
var pk_class = new RegExp(’(?:^| )piwik(download|link)(?: |$)‘);
var _pk_download = new RegExp(’\.(’ + _pk_download_extensions + ‘)$’, ‘i’);
‘’if (_pk_link_type == ’link’)
pk_not_site_hostname = 1;
else if (!_pk_linktype)
pk_link_type = (_pkdownload.test(source.href) ? ‘download’ : ‘link’);’’
Now with how the structure changed looks like I need to add a new statement to declare _pk_class to “myDownloadClass”.
Not sure if this was easy to understand and its not a bug fix but maybe an enhancement for future release where the user can either change the piwik download/link tracking with either changing in the .js or the standard adding piwik_download class to the website itself.
Maybe set the default of choosing the class to “piwik_download” so for users that don’t modify the .js it will not affect them.
As of now I am running my old piwik.js with 0.2.29 and all is working well still but once there are updates to the .js maybe this could be added as a new feature
Thanks,
Tom
The text was updated successfully, but these errors were encountered: