Giveth / impact-graph

MIT License
49 stars 18 forks source link

Update user profile on Donation Made #1290

Closed divine-comedian closed 7 months ago

divine-comedian commented 7 months ago

When a user makes a donation on Giveth we should track that user and add them to Ortto - since it not only sends emails but acts as a CDP, allowing us to make future campaigns or communications with them.

However as part of #1239 we no longer send emails to the users for every donation they make. So we will need to use another type of API call to add them into our CDP on Ortto.

To do this we need to call this API when a user makes a donation: https://help.ortto.com/a-257-create-or-update-one-or-more-people-merge

This needs to get the following info of the donor

From there we should set the following in the API call:

add these value to the person fields: (I've included their associated ID)

add these tags to the person in the same call:

merge and find strategy can be left as default and don't need to be defined I think

divine-comedian commented 7 months ago

Add in a tag to know if they have ever donated on a particular chain

divine-comedian commented 7 months ago

example of attritbutes looks like this:

"attributes": {
                "dtz:cm:date-of-donation": {
                    "year": 2024,
                    "month": 2,
                    "day": 18,
                    "timezone": "UTC"
                },
                "int:cm:donations-count-": 1708255883,
                "int:cm:total-donated-usd": 1708255883,
                "str:cm:email": "example string value",
                "str:cm:firstname": "example string value",
                "str:cm:lastname": "example string value",
                "str:cm:projecttitle": "example string value",
                "str:cm:userid": "example string value"
            },
maryjaf commented 7 months ago

How can I test this issue? @RamRamez

RamRamez commented 7 months ago

How can I test this issue? @RamRamez

We don't have a separate environment for staging on Ortto so if we test it on staging, the real users on Ortto will be affected.

divine-comedian commented 7 months ago

How can I test this issue? @RamRamez

We don't have a separate environment for staging on Ortto so if we test it on staging, the real users on Ortto will be affected.

We'll make the fix as we suggested Ramin - so we won't send the userId on staging. it will fallback to using email and should be testable then - please update here when its been changed and can be tested.

RamRamez commented 7 months ago

How can I test this issue? @RamRamez

We don't have a separate environment for staging on Ortto so if we test it on staging, the real users on Ortto will be affected.

We'll make the fix as we suggested Ramin - so we won't send the userId on staging. it will fallback to using email and should be testable then - please update here when its been changed and can be tested.

Done! @maryjaf You can start testing.

@divine-comedian can you please create an Ortto account for Maryam to test these issues?

jainkrati commented 7 months ago

@maryjaf pls close the issue once you have tested

maryjaf commented 7 months ago

@divine-comedian can you please create an Ortto account for Maryam to test these issues?

Please let me know whenever Ortto account will be create.

divine-comedian commented 7 months ago

@divine-comedian can you please create an Ortto account for Maryam to test these issues?

Please let me know whenever Ortto account will be create.

Sent - will follow up with you in DMs

maryjaf commented 7 months ago

1- If a user has more than 1 project, the last project that has been created by user is shownin this field is this a expected result?

image.png
maryjaf commented 7 months ago

2- I couldn't see these fiels in below link : -donation chain -GIVbacks round donated in (if donation was eligible) -QF round donated in (if donation was eligible)

https://ortto.app/ap2-giveth/cdp/people/0065d6435dd6b39392339500/activities?from=cdp-filter&key=people-all-

3- and User ID would be set only on production? because for this user, user ID hasn't been set https://ortto.app/ap2-giveth/cdp/people/0065d6435dd6b39392339500/activities?from=cdp-filter&key=people-all-nela

image

@RamRamez

maryjaf commented 7 months ago

4- recurring donation also should be shown in this list? @RamRamez @divine-comedian

RamRamez commented 7 months ago

If a user has more than 1 project, the last project that has been created by user is shownin this field is this a expected result?

image.png

I don't know how ProjectTitle is being updated. Maybe @divine-comedian has an idea. However "ProjectTitle" is not related to this issue.

maryjaf commented 7 months ago

However "ProjectTitle" is not related to this issue.

Yeah but i didn't find an issue related to this field on user profile issue also there isn't this field

RamRamez commented 7 months ago

4- recurring donation also should be shown in this list? @RamRamez @divine-comedian

I talked with @mohammadranjbarz and when we develop verifying recurring donations, we'll update Ortto too (only those three fields).

RamRamez commented 7 months ago

2- I couldn't see these fiels in below link : -donation chain -GIVbacks round donated in (if donation was eligible) -QF round donated in (if donation was eligible)

https://ortto.app/ap2-giveth/cdp/people/0065d6435dd6b39392339500/activities?from=cdp-filter&key=people-all-

3- and User ID would be set only on production? because for this user, user ID hasn't been set https://ortto.app/ap2-giveth/cdp/people/0065d6435dd6b39392339500/activities?from=cdp-filter&key=people-all-nela image

@RamRamez

  1. Donation chain and Givbacks round are updated in the Tags section. I think there's a bug with QFRound, I'll take a look.

  2. User ID is not updated. On Staging Ortto users may not have User ID assigned but in production all users must have.

divine-comedian commented 7 months ago

1- If a user has more than 1 project, the last project that has been created by user is shownin this field is this a expected result?

image.png

It was an error in the setting I made related to project created - it should be fixed now

maryjaf commented 7 months ago
  • Donation chain and Givbacks round are updated in the Tags section. I think there's a bug with QFRound, I'll take a look.

The problem related to QF round has been resolved