首页 > 解决方案 > 如何将对象映射到 C# 中谷歌分析事件的正确查询字符串?

问题描述

我需要从服务器发送谷歌分析事件,但找不到有关如何正确映射对象的文档。

我需要发送这样的事件

 {
  "event": "nameOfEvent",
  "ecommerce": {
    "currencyCode": "eur",
    "purchase": {
      "actionField": {
        "id": "9d9e3cc9-0007-4aaa-d986-08d6g2f07b63",
        "affiliation": "",
        "revenue": 100
      },
      "products": [
        {
          "name": "Product name",
          "id": "id",
          "price": 200,
          "category": "Category",
          "variant": "Buy online",
          "quantity": "1",
          "dimension1": "1",
          "dimension2": "2",
          "dimension3": "3"
        }
      ]
    }
  }
}

结果应该和https://www.google-analytics.com/debug/collect?v=1&t=event&tid=UA-222-1&uid=1&el=nameOfEvent&这里类似 我有问题,下一步怎么办???我将不胜感激任何帮助!

标签: c#google-analytics

解决方案


看起来可能是这个的副本。手动将数据发送到 Google Analytics

上面的帖子引用了 Google 测量协议的 C# 实现https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide


推荐阅读