跟踪下载包括自定义尺寸

Track download including custom dimensions

我正在尝试将 Google Analytics 的解决方案应用到 Matomo。 在 Google 分析中,我有:

我的代码是这样的:

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 中,我可以拥有自定义报告,例如:

在 Matomo 中是否可以通过自定义事件发送 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'}]);

您提到的解决方案应该可行,但可能会出现延迟(例如大约一小时):

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
  }
]);