amp-by-example icon indicating copy to clipboard operation
amp-by-example copied to clipboard

amp-experiment: sample code is missing?

Open ryota-yamada-jp opened this issue 10 years ago • 3 comments

Hello,

<amp-analytics type="googleanalytics" id="analytics">
  <script type="application/json">
    {
      "vars": {
        "account": "UA-73836974-1"
      },
      "requests": {
        "exp": "${host}/r/collect?t=exp&xid=${experiment}&xvar=${variant}"
      },
      "triggers": {
        "default pageview": {
          "on": "visible",
          "request": "pageview",
          "request": "exp",
          "vars": {
            "title": "amp-experiment",
            "experiment": "button-color-experiment",
            "variant": "VARIANT(button-color-experiment)"
          }
        }
      }
    }
  </script>
</amp-analytics>

This application/json object has duplicate key "request". Is it missing or not?

Thanks, Ryota.

ryota-yamada-jp avatar Nov 15 '16 00:11 ryota-yamada-jp

Thanks for reporting. The first request attribute is invalid.

sebastianbenz avatar Nov 15 '16 07:11 sebastianbenz

@sebaperez Thanks for your response. Good!

ryota-yamada-jp avatar Nov 15 '16 07:11 ryota-yamada-jp

Hi, I'm trying to find out how to send the experiment data to google analytics? Do I need to create an experiment in google analytics first ?

walter0331 avatar Nov 17 '16 11:11 walter0331