Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
4.2 kB
1
Indexable
Never
[
      {
        "name": "get_conversion_rate",
        "interval": "2021-12-30T23:00:00.000Z/2022-05-24T22:00:00.000Z",
        "granularity": {
          "period": "PT1H",
          "timeZone": "Europe/Berlin"
        },
        "queries": [
          {
            "outputSeries": "orders",
            "table": "clickstream",
            "query": {
              "aggregations": [
                {
                  "type": "count_distinct",
                  "name": "orders",
                  "column": "profile_id"
                }
              ],
              "filter": {
                "and": [
                  {
                    "or": {{buyersIdsFilter}}
                  },
                  {
                    "or": [
                      {
                        "type": "equal",
                        "column": "schema",
                        "value": "context/commerce/carouselViewed"
                      },
                      {
                        "type": "equal",
                        "column": "schema",
                        "value": "context/commerce/carouselClicked"
                      }
                    ]
                  },
                  {
                    "type": "equal",
                    "column": "carousel_id",
                    "value": "merchcarouselComponentcmsitem_00002001"
                  }
                ]
              },
              "dimensions": []
            }
          },
          {
            "outputSeries": "impressions",
            "table": "clickstream",
            "query": {
              "aggregations": [
                {
                  "type": "count_distinct",
                  "name": "impressions",
                  "column": "profile_id"
                }
              ],
              "filter": {
                "and": [
                  {
                    "or": [
                      {
                        "type": "equal",
                        "column": "schema",
                        "value": "context/commerce/carouselViewed"
                      },
                      {
                        "type": "equal",
                        "column": "schema",
                        "value": "context/commerce/carouselClicked"
                      }
                    ]
                  },
                  {
                    "type": "equal",
                    "column": "carousel_id",
                    "value": "merchcarouselComponentcmsitem_00002001"
                  }
                ]
              },
              "dimensions": []
            }
          }
        ],
        "operations": [
          {
            "type": "zeroFill",
            "outputSeries": "zero_filled_orders",
            "outputField": "orders",
            "inputSeries": "orders",
            "inputField": "orders"
          },
          {
            "type": "zeroFill",
            "outputSeries": "zero_filled_impressions",
            "outputField": "impressions",
            "inputSeries": "impressions",
            "inputField": "impressions"
          },
          {
            "type": "division",
            "outputSeries": "orders_over_impressions",
            "outputField": "rate",
            "numerator": {
              "inputSeries": "zero_filled_orders",
              "inputField": "orders"
            },
            "denominator": {
              "inputSeries": "zero_filled_impressions",
              "inputField": "impressions"
            }
          },
          {
            "type": "multiplication",
            "outputSeries": "conversion_rate",
            "outputField": "rate",
            "multiplier": {
              "inputSeries": "orders_over_impressions",
              "inputField": "rate"
            },
            "multiplicand": 100
          }
        ],
        "formats": [
          {
            "type": "timeSeries",
            "outputSeries": "conversion_rate",
            "inputSeries": "conversion_rate",
            "values": [
              {
                "outputField": "y",
                "inputField": "rate"
              }
            ]
          }
        ]
      }
    ]