最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - INVALID_ARGUMENT in Google Analytics - Stack Overflow

programmeradmin2浏览0评论

Unable to retrieve event parameters associated with events.

I am integrating Google Analytics into my website and trying to fetch events using the Analytics Data API. However, the parameters I sent with these events are not included in the API response.

Additionally, my events are being deleted from the Google Analytics dashboard, but they still appear in the API results.

I am doing it this way:

async function runRealtimeReport() {
  const [response] = await analyticsDataClient.runRealtimeReport({
    property: `properties/${propertyId}`,
    dimensions: [
      { name: "eventName" },
      { name: "eventParams.video_id" }, // I also tried {name: "customEvent:video_id"}
      { name: "eventParams.duration" }, // {name: "customEvent:duration"}
    ],
    metrics: [{ name: "eventCount" }],
  });

  console.log("Report result:", JSON.stringify(response, null, 2));
  printRunReportResponse(response);
}

I initially did not include eventParams.video_id and duration, but after realizing that my parameters were missing from the response, I added them. I also tried registering my custom dimensions with an event scope, but they are still not working

发布评论

评论列表(0)

  1. 暂无评论