Tracardi / tracardi

TRACARDI is a new HOME for your customer data. TRACARDI is an Composable API-first solution for any company that need inexpensive CDP to intergrate with.
https://www.tracardi.com
Other
519 stars 95 forks source link

0.8.2-rc2 merge problem #850

Closed MaratIR closed 7 months ago

MaratIR commented 10 months ago

0.8.2-rc2 merge problem

For example, we use a channel that automatically generates a profile on the tracardi side. for this channel we also configure merge by phone number. We also have a channel that specifies a static profile-id. and there is no merge here. but if we pass an event to the first channel with the phone number of the profile created by the second channel, we get a new profile with a static id as an alias, and we can explicitly write data to such a profile. but with this scheme it is found that Visits is counted as the previous one (like Visits*2+1).

first:

{
  "source": {
    "id": "d3fb6e66-cfb4-4122-9646-43dc6e8eed0d"
  },
  "session": {
    "id": "0000000000000000000000000118"
  },
  "events": [
    {
      "type": "page-view",
      "properties" : { 
              "phone": "+1003",
              "item": "molot",
              "email": "qwest@gmail.com"
            } 
    },
    {
      "type": "page-view"
    }
  ],
  "options": {
      "debugger": "true"
  }
} 

second:

{
  "source": {
    "id": "7ed783ac-b183-4a50-a2c1-f92df0d31602"
  },
  "profile": {
      "id": "1003"
  },
  "session": {
    "id": "200000000000000000000000124"
  },
  "events": [
    {
      "type": "Sign-Up",
      "properties" : { 
              "firstName": "Johna",
              "lastName": "Does",
              "email": "qwert1y@gmail.com",
              "phone": "+1003",
              "ClientID": "3001",
              "ZoneID": "47551",
              "deviceBrand": "Samsung",
              "deviceType": "mobile",
              "deviceModel": "A32",
              "city": "London",
              "country": "UK"
            }   
    },
    {
      "type": "Sign-Up"
    }
  ],
  "options": {
      "debugger": "true"
  }
} 

profile

{
  "id": "e7392623-6edc-4086-83a5-f68e8343aab8",
  "ids": [
    "49c7963e-681c-490f-baba-6efa893b33d4",
    "a44ccaf6-7cc6-4243-af73-aa230415a731",
    "9b6da7de-d712-4d97-aefe-45f098c61496",
    "56595082-3d0d-4a5d-9359-59fb03c2b3f7",
    "e7392623-6edc-4086-83a5-f68e8343aab8",
    "9108864c-86e0-4db3-9dc8-d1132066320c",
    "74e5f6c3-11fe-4698-8a2d-7f610aa44559",
    "6d64fa0f-4a0b-47bd-84ab-618feff209cc",
    "7bd237a4-7b48-4a08-8492-bb11bc052123",
    "1003"
  ],
  "metadata": {
    "time": {
      "insert": "2023-11-29T13:15:00.051360",
      "create": null,
      "update": "2023-12-04T11:25:27.265931",
      "segmentation": null,
      "visit": {
        "last": null,
        "current": null,
        "count": 231,
        "tz": null
      }
    },
    "aux": {},
    "status": null,
    "fields": {}
  },
  "stats": {
    "visits": 0,
    "views": 0,
    "counters": {}
  },
  "traits": {
    "zoneids": [
      "47552",
      "47551",
      "47554"
    ],
    "zone_count": {
      "47551": 5,
      "47552": 1,
      "47554": 5
    },
    "clientids": [
      "3003",
      "3001",
      "3002"
    ],
    "client_count": {
      "3001": 5,
      "3002": 1,
      "3003": 5
    },
    "item": "molotok"
  },
  "segments": [],
  "interests": {},
  "consents": {},
  "active": true,
  "aux": {
    "conflicts": {
      "traits": {
        "zoneids": [
          "47552",
          "47551",
          "47554"
        ],
        "zone_count": {
          "47551": 5,
          "47552": 1,
          "47554": 5
        },
        "clientids": [
          "3003",
          "3001",
          "3002"
        ],
        "client_count": {
          "3001": 5,
          "3002": 1,
          "3003": 5
        },
        "item": "molotok"
      },
      "data": {
        "preferences": {
          "colors": [],
          "brands": "Samsung",
          "fragrances": [],
          "purchases": [],
          "channels": [],
          "services": [],
          "sizes": [],
          "devices": "A32",
          "other": "mobile",
          "payments": []
        },
        "loyalty": {
          "codes": [],
          "card": {
            "points": 0
          }
        },
        "pii": {
          "attributes": {},
          "language": {},
          "education": {},
          "civil": {},
          "lastname": "Does",
          "firstname": "Johna"
        },
        "identifier": {},
        "job": {
          "company": {}
        },
        "media": {
          "social": {
            "other": {}
          }
        },
        "devices": {
          "last": {
            "geo": {
              "country": {}
            }
          },
          "push": [],
          "other": []
        },
        "contact": {
          "address": {
            "country": "UK",
            "town": "London"
          },
          "email": {
            "main": "qwert1y@gmail.com"
          },
          "confirmations": [],
          "app": {
            "other": {}
          },
          "phone": {
            "mobile": "+1003"
          }
        },
        "metrics": {
          "ltcosv": 0,
          "ltv": 0,
          "ltcosc": 0,
          "ltcop": 0,
          "ltcocc": 0,
          "custom": {},
          "ltcocv": 0
        },
        "anonymous": false
      }
    }
  },
  "data": {
    "anonymous": false,
    "pii": {
      "firstname": "Johna",
      "lastname": "Does",
      "display_name": null,
      "birthday": null,
      "language": {
        "native": null,
        "spoken": null
      },
      "gender": null,
      "education": {
        "level": null
      },
      "civil": {
        "status": null
      },
      "attributes": {
        "height": null,
        "weight": null,
        "shoe_number": null
      }
    },
    "contact": {
      "email": {
        "main": "qwert1y@gmail.com",
        "private": null,
        "business": null
      },
      "phone": {
        "main": null,
        "business": null,
        "mobile": "+1003",
        "whatsapp": null
      },
      "app": {
        "whatsapp": null,
        "discord": null,
        "slack": null,
        "twitter": null,
        "telegram": null,
        "wechat": null,
        "viber": null,
        "signal": null,
        "other": {}
      },
      "address": {
        "town": "London",
        "county": null,
        "country": "UK",
        "postcode": null,
        "street": null,
        "other": null
      },
      "confirmations": []
    },
    "identifier": {
      "id": null,
      "badge": null,
      "passport": null,
      "credit_card": null,
      "token": null,
      "coupons": null
    },
    "devices": {
      "push": [],
      "other": [],
      "last": {
        "geo": {
          "country": {
            "name": null,
            "code": null
          },
          "city": null,
          "county": null,
          "postal": null,
          "latitude": null,
          "longitude": null
        }
      }
    },
    "media": {
      "image": null,
      "webpage": null,
      "social": {
        "twitter": null,
        "facebook": null,
        "youtube": null,
        "instagram": null,
        "tiktok": null,
        "linkedin": null,
        "reddit": null,
        "other": {}
      }
    },
    "preferences": {
      "purchases": [],
      "colors": [],
      "sizes": [],
      "devices": [
        "A32"
      ],
      "channels": [],
      "payments": [],
      "brands": [
        "Samsung"
      ],
      "fragrances": [],
      "services": [],
      "other": [
        "mobile"
      ]
    },
    "job": {
      "position": null,
      "salary": null,
      "type": null,
      "company": {
        "name": null,
        "size": null,
        "segment": null,
        "country": null
      },
      "department": null
    },
    "metrics": {
      "ltv": 0,
      "ltcosc": 0,
      "ltcocc": 0,
      "ltcop": 0,
      "ltcosv": 0,
      "ltcocv": 0,
      "next": null,
      "custom": {}
    },
    "loyalty": {
      "codes": [],
      "card": {
        "id": null,
        "name": null,
        "issuer": null,
        "expires": null,
        "points": 0
      }
    }
  }
}

image previos image next

atompie commented 7 months ago

Solved with APM (Automatic Profile Merging)