snowplow / snowplow-javascript-tracker

Snowplow event tracker for client-side and server-side JavaScript. Add analytics to your websites, web apps and servers.
http://snowplowanalytics.com
BSD 3-Clause "New" or "Revised" License
543 stars 220 forks source link

Explore GET requests with content type application/x-www-form-urlencoded #489

Closed fblundun closed 8 years ago

fblundun commented 8 years ago

This is happening on all Lumia devices. This triggers a failure here. We can fix this by permitting GET requests with a content-type.

bogaert commented 8 years ago

Example bad row:

{
    "line": "2016-05-05\t12:00:37\t-\t43\t92.90.16.37\tGET\t92.90.16.37\t/i\t200\thttp://www.example.com/?locale=fr&eso=MTU2MjQxNjg3OkNKZWV3RW9TRWdrNFJvSDdhWVlYbWhGaVg5bmRFdzdtakJvTUNLbUZtSWJJS2hJRFZWUkRJZ2NJNEE4UUJSZ0lNSkxiRnpqUGxoZENBZ2dqVUFCUUFWQUNVQU5hSmdvYVoySnBZak00YzNGMmJqbDBaamN3WmpCb01UQjBaREpxTkRNUU1Cb0NabklpQW1aeQ==\tMozilla%2F5.0+%28Mobile%3B+Windows+Phone+8.1%3B+Android+4.0%3B+ARM%3B+Trident%2F7.0%3B+Touch%3B+rv%3A11.0%3B+IEMobile%2F11.0%3B+NOKIA%3B+Lumia+930%29+like+iPhone+OS+7_0_3+Mac+OS+X+AppleWebKit%2F537+%28KHTML%2C+like+Gecko%29+Mobile+Safari%2F537\te=se&se_ca=core&se_ac=switch-tab&se_la=156241687&se_pr=flight&tv=js-2.5.3&tna=cj&aid=mw&p=web&tz=Europe%2FBerlin&lang=fr-FR&cs=utf-8&f_java=1&res=403x716&cd=24&cookie=1&eid=4b971c58-2412-42d1-b89c-37bf80a6b7bf&dtm=1462449381243&vp=320x524&ds=320x525&vid=1&sid=e845de0b-0084-4069-81fe-edb3a4780d93&duid=9dc7ed9bba0ecd3f&fp=4250321974&refr=http%3A%2F%2Fwww.example.com%2Ftravel-search%2Fresults%2F156241687%2Fbus%3Flocale%3Dfr&url=http%3A%2F%2Fwww.example.com%2Ftravel-search%2Fresults%2F156241687%2Fflight%3Flocale%3Dfr&cv=clj-1.0.0-tom-0.2.0&nuid=fcd72d54-8adc-4a1a-b557-ff867912bbfe\t-\t-\t-\tapplication%2Fx-www-form-urlencoded\t-",
    "errors": [{
        "level": "error",
        "message": "Operation must be POST, not GET, if request content type and/or body are provided"
    }],
    "failure_tstamp": "2016-05-05T14:26:25.573Z"
}
fblundun commented 8 years ago

Replacing tabs with newlines:

2016-05-05
12:00:37
-
43
92.90.16.37
GET
92.90.16.37
/i
200
http://www.example.com/?locale=fr&eso=MTU2MjQxNjg3OkNKZWV3RW9TRWdrNFJvSDdhWVlYbWhGaVg5bmRFdzdtakJvTUNLbUZtSWJJS2hJRFZWUkRJZ2NJNEE4UUJSZ0lNSkxiRnpqUGxoZENBZ2dqVUFCUUFWQUNVQU5hSmdvYVoySnBZak00YzNGMmJqbDBaamN3WmpCb01UQjBaREpxTkRNUU1Cb0NabklpQW1aeQ==
Mozilla%2F5.0+%28Mobile%3B+Windows+Phone+8.1%3B+Android+4.0%3B+ARM%3B+Trident%2F7.0%3B+Touch%3B+rv%3A11.0%3B+IEMobile%2F11.0%3B+NOKIA%3B+Lumia+930%29+like+iPhone+OS+7_0_3+Mac+OS+X+AppleWebKit%2F537+%28KHTML%2C+like+Gecko%29+Mobile+Safari%2F537
e=se&se_ca=core&se_ac=switch-tab&se_la=156241687&se_pr=flight&tv=js-2.5.3&tna=cj&aid=mw&p=web&tz=Europe%2FBerlin&lang=fr-FR&cs=utf-8&f_java=1&res=403x716&cd=24&cookie=1&eid=4b971c58-2412-42d1-b89c-37bf80a6b7bf&dtm=1462449381243&vp=320x524&ds=320x525&vid=1&sid=e845de0b-0084-4069-81fe-edb3a4780d93&duid=9dc7ed9bba0ecd3f&fp=4250321974&refr=http%3A%2F%2Fwww.example.com%2Ftravel-search%2Fresults%2F156241687%2Fbus%3Flocale%3Dfr&url=http%3A%2F%2Fwww.example.com%2Ftravel-search%2Fresults%2F156241687%2Fflight%3Flocale%3Dfr&cv=clj-1.0.0-tom-0.2.0&nuid=fcd72d54-8adc-4a1a-b557-ff867912bbfe
-
-
-
application%2Fx-www-form-urlencoded
-
alexanderdean commented 8 years ago

Great catch!

TimmyCarbone commented 8 years ago

+1 !

In the meantime, replaying the event without the content type should fix it ... I guess?

alexanderdean commented 8 years ago

Yes @TimmyCarbone that workaround should fix it.

This ticket should have been created in the main Snowplow repo - migrated: https://github.com/snowplow/snowplow/issues/2743