lytics / ios-sdk

MIT License
0 stars 0 forks source link

`Name` property doesn't seem to impact any of the outbound payloads. #51

Closed markhayden closed 1 year ago

markhayden commented 1 year ago

Tested this across track, identify, consent, etc. and I don't believe in any of those cases passing a name as a top level attribute has any impact on the outbound payload. I believe in the spec we determined it should look something like:

[
    {
        "eventName": "cart_add",
        "_ts": 1666115807452,
        "_sesstart": 1,
        "properties":{
            "cartItems": 10,
            "cartTotal": 59.99,
            "cartId": "d45c186e-347a-11ed-a261-0242ac120002"
        }
    }
]

where eventName is the value of the name but let me know if that was not the case.

mgacy commented 1 year ago

@markhayden the behavior I am seeing (on the bugfix/38-lyticsconfiguration-should-allow-for-setting-a-custom-baseurl-and-path branch, at least) is that the following:

struct DemoTapEvent: Encodable {
    var artistID: Int
    var eventID: Int
}

Lytics.shared.track(
    name: "Event_Tap",
    properties: DemoTapEvent(
        artistID: 105,
        eventID: 5))

results in the following request:

{
  "identifiers": {
    "_uid": "2B741681-C5CD-463E-9654-9EC7F6B38E83"
  },
  "properties": {
    "eventID": 5,
    "artistID": 105
  },
  "_ts": 1668611995368,
  "name": "Event_Tap"
}

Is the desired behavior that the name field be eventName here?

markhayden commented 1 year ago

Entirely possible I am a doofus and just missed this at the bottom of the payload. I'll assign to myself and test again.

markhayden commented 1 year ago

Looks like that was fixed at some point somewhat recentlyish (last week or so). Either way I merged in the latest main branch and looks like all is well now. Closing.