snowplow / snowplow-actionscript3-tracker

Snowplow event tracker for ActionScript 3.0. Add analytics to your Flash Player 9+, Flash Lite 4 and AIR games, apps and widgets
http://snowplowanalytics.com
4 stars 1 forks source link

Screen_view event sent in via POST doesn't appear to have the correct data structure #13

Closed yalisassoon closed 9 years ago

yalisassoon commented 9 years ago

I can see a screen_view event sent in on the 18th structured as follows:

{
    "schema": "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-0",
    "data": [
        {
            "schema": "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",
            "tz": "Etc/UTC-2:00",
            "e": "ue",
            "tna": "AF003",
            "co": "{\"schema\":\"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0\",\"data\":[{\"schema\":\"iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1\",\"data\":{\"targetUrl\":\"http://www.google.com\"}},{\"schema\":\"iglu:com.snowplowanalytics.snowplow/flash_context/jsonschema/1-0-0\",\"data\":{\"hasLocalStorage\":true,\"stageSize\":{\"height\":893,\"width\":1131},\"version\":\"WIN 11,1,102,63\",\"isDebugger\":true,\"playerType\":\"ActiveX\",\"hasScriptAccess\":true}}]}",
            "dtm": "1421582630549",
            "tv": "as3-0.1.0",
            "data": {
                "schema": "iglu:com.snowplowanalytics.snowplow/screen_view/jsonschema/1-0-0",
                "data": {
                    "id": "screen_1"
                }
            },
            "vp": "320x480",
            "aid": "cloudfront",
            "p": "pc",
            "eid": "91330203-7ef9-02ad-715d-66239902f5b9"
        }
    ]
}

There are several problems with this:

  1. The screen view event is sent in on the wrong parameter - it is sent in on data instead of ue_px or ue_pr (depending on whether it is URI or base64 encoded respectively)
  2. The unstruct_event schema (iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0) should be sent in as the first field in the ue_px or ue_pr object referenced above
  3. The entire block inside ue_px or ue_pr is not a JSON - it's a stringified JSON with either base64 or uri encoding
  4. Note that the screen_view schema must live inside the unstruct_event, as illustrated below
[payload data
  [ue_pr|x
    [unstruct_event
      [screen_view

Hope that makes sense - please can you ping @alexanderdean if any of the above is unclear?

Thanks!

natilivni commented 9 years ago

fixed in commit 2a97729d6f76d8f761ba8a18c40f5ec7d42eaa14