在谷歌分析中,我有:
我的代码是这样的:
function track_download(data) { var GA = window.ga || function() { // ga is not defined, log function arguments if (window.console) { console.log([].slice.call(arguments)); } }; // Custom dimensions GA('set', 'dimension1', data.some_profile_information1); GA('set', 'dimension2', data.some_profile_information2); GA('set', 'dimension3', data.some_profile_information3); // Track event GA('send', { 'hitType': 'event', // Required. 'eventCategory': 'page', // Required. 'eventAction': 'custom_download', // Required. 'eventLabel': data.the_title_of_downloaded_section, 'eventValue': 1 }); };
在Google Analytics中,我可以定制如下报告:
在马托莫有没有可能 custom dimensions 为了拥有相同的报告/行为而使用自定义事件?
更新:
像这样尝试,在自定义维度的报告中没有数据。
var MA = window._paq || function() { // Matomo is not defined, log function arguments if (window.console) { console.log([].slice.call(arguments)); } }; MA.push([ 'trackEvent', 'page', // category 'my_custom_download', // action data.item_title, // name 1, // value { // custom dimensions dimension1: data.dim1, dimension2: data.dim2, dimension3: data.dim3 } ]);
这是从 docs : _paq.push(['trackEvent', category, action, name, value, {dimension1: 'DimensionValue'}]);
_paq.push(['trackEvent', category, action, name, value, {dimension1: 'DimensionValue'}]);
您提到的解决方案应该有效,但可能会出现延迟(例如,大约一小时):