Page MenuHomePhabricator

Non-donor status missing records in our segmentation framework
Closed, ResolvedPublic

Description

We found an error with the non-donor status in the Civi segmentation framework: https://civicrm.wikimedia.org/civicrm/wmf-segment

First, we have two non-donor values (one for status and one for segment), and they should equal the same count, correct? We've found that they produce different counts based on the country splits we've done with the framework here: https://docs.google.com/spreadsheets/d/1yfKqO0DD2Wo2HiwDfMVOuhBtMAco2ADNVJdxVrpg6Og/edit#gid=443606469

Second, we notice that RML sign-up non-donors are not being captured in the Non-donor status/segment counts (and we think they should count). They sit in Civi as email address and home country/language only. Example case: CID 21435526

Can we take a look at this together and amend? Thanks!

Event Timeline

KHaggard renamed this task from RML non-donors are not being counted in our segmentation framework to Non-donor status missing records in our segmentation framework.May 1 2024, 11:41 PM

Change #1034580 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Remove old WMFDataManagement.updateWMFDonor api

https://gerrit.wikimedia.org/r/1034580

So the first problem here is that when we export to Acoustic we merge contacts regardless of whether they are merged in CiviCRM - they could be set to deliberately not merge in CiviCRM or they might be just not-yet-merged.

When we do that we set the donor_status to be the HIGHEST value and the segment to be the LOWEST

Ideally we would set both to be the LOWEST - looking at https://civicrm.wikimedia.org/civicrm/wmf-segment that is most logical.

I think what happened is the numbers were assigned to the statuses and then some re-jigging happened, meaning that the recur statuses are the highest priority but not numbered as such.

I suspect what we should do is re-number them from 80-95 to 1-4 & then the MIN would work & the order would be as prioritised - but I'm unsure how that would flow on as the numbering came from @ERoden-WMF

(ping @JMando too)

Thanks @Eileenmcnaughton I don't think the numbering had any significance, particularly for the statuses as we were just selecting different number ranges for each. From memory we didn't want the status numbers to be the same as the segments so we used random numbers. I'm fine with changing these to whatever ensures that the queries is pulling donors into the correct segment/status.

Change #1035026 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Fix WMFDonor statuses so that we can use MIN()

https://gerrit.wikimedia.org/r/1035026

Change #1035026 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Fix WMFDonor statuses so that we can use MIN()

https://gerrit.wikimedia.org/r/1035026

Change #1035047 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Clean up confusion where donor segment is non donor but status is not

https://gerrit.wikimedia.org/r/1035047

Change #1035047 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Clean up confusion where donor segment is non donor but status is not

https://gerrit.wikimedia.org/r/1035047

@KHaggard the places where one of donor_status & donor_segment being set & not the other will be from when we first added the fields - I ran an update to ensure that if one is set both are set to reduce the confusion. I also fixed our export such that if a contact does not have a segment / status in CiviCRM the export will set it to non-donor rather than blank.

Of course that only applies if the donor is exported from CiviCRM & I worry that relying on CiviCRM to push up the field for non-donors (with this data not being stored in CiviCRM) is going to have a long tail of maintenance/ inconsistencies- a more reliable way would be to set a default on the fields at the Acousitc end such that any contacts when created have that value - I'd be very surprised if Acoustic doesn't allow you to do that - might be worth checking with Brian if you are not sure

@KHaggard @JMando @ERoden-WMF we have updated the numbering for the statuses (the recurring ones) - the documentation updates automatically - https://civicrm.wikimedia.org/civicrm/wmf-segment when we make changes

This should mean that when 2 contacts are 'Acoustic Merged' the recurring statuses will take precedence over any other status

Thanks all. Quick question for you @Eileenmcnaughton - Mariana brought to my attention that Major Donor segment and Non-Donor Status share the same id = 100.
Can I request that we make sure all statuses and segments have no overlap in id? I think it would make things clearer and reduce the need for our teams to re-clarify "which 100" often.

Maybe we can make Non-donor status 1001 to closer match the Non-donor segment? What do you think?

And to answer your other question, we can use Acoustic to set default values but due to new sign-ups I wonder if we would have to routinely reset that value over and over throughout the year. Do we know if new RML signups that don't donate get updated again/overwritten in Acoustic after they're imported in Civi?

Change #1034580 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Remove old WMFDataManagement.updateWMFDonor api

https://gerrit.wikimedia.org/r/1034580

@KHaggard - yes we can change the value to 1000 or 1001 instead of 100 - ideally right away as we are in maintenance week - it's fine for them to be 1000 like the other if that is more sane. There was some idea that the numbers could be added together to get a number that represents a combined segment but not sure if that is worth considering

  • We DO update the segment when we export to Acoustic so yes, RML contacts who give should be updated as they give

Yeah, actually if they are the same, then 1000 for both status and segment makes sense to me. Thank you.

and thanks yes their donation would carry over /update - but I meant if a RML sign-up comes in and they don't donate, I'm quite sure Civi has the RML sign-up record (just email and country/lang only, no donation). I'm asking if an RML sign-up in Civi would push over again to Acoustic with the non-donor status. Do I have that right?

@KHaggard so if someone donates via RML & has a non-donor status we do pretty much suck them into Civi & update Acoustic with the CiviCRM contact ID - but we would leave that non-donor status in place. If they later donate then their status is updated like any other donor - ok with 1000!

Change #1035571 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Update the non-donor value to 1000 for segments

https://gerrit.wikimedia.org/r/1035571

@KHaggard we are also pushing up slightly different words - Non donor vs Non Donors - should we consolidate that? if so how should we capitilize?

  1. Non donor
  2. Non Donor

Change #1035571 merged by Dwisehaupt:

[wikimedia/fundraising/crm@master] Update the non-donor value to 1000 for segments

https://gerrit.wikimedia.org/r/1035571

Change #1035587 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Update triggers

https://gerrit.wikimedia.org/r/1035587

Change #1035587 merged by Dwisehaupt:

[wikimedia/fundraising/crm@master] Update triggers

https://gerrit.wikimedia.org/r/1035587

@KHaggard from today's run the non donor number should be changed to 1000 fr donor_status_id

@KHaggard we are also pushing up slightly different words - Non donor vs Non Donors - should we consolidate that? if so how should we capitilize?

  1. Non donor
  2. Non Donor

I think we should consolidate. "Non Donor" works for me. Thanks!

Also @Eileenmcnaughton Can I just confirm: you would like me to run a query in Acoustic for all non-donors and manually set their status and segment to 1000 for Non Donor? And this will only need to be done once because Civi can do per record updates as needed from there? Just making sure I understood you correctly. Thanks!

Change #1035828 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/tools@deploy] Consolidate naming on non-donor fields

https://gerrit.wikimedia.org/r/1035828

Change #1035830 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Consolidate non-donor label

https://gerrit.wikimedia.org/r/1035830

@KHaggard well it would only need to be done once as long as it is also possible to set a default value for the field in Acoustic so that any new records that do not have values get them when created (which seems like RML)

Change #1035828 merged by jenkins-bot:

[wikimedia/fundraising/tools@deploy] Consolidate naming on non-donor fields

https://gerrit.wikimedia.org/r/1035828

Change #1035833 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/tools@master] Consolidate naming on non-donor fields

https://gerrit.wikimedia.org/r/1035833

Change #1035833 merged by jenkins-bot:

[wikimedia/fundraising/tools@master] Consolidate naming on non-donor fields

https://gerrit.wikimedia.org/r/1035833

Change #1035830 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Consolidate non-donor label

https://gerrit.wikimedia.org/r/1035830

Eileenmcnaughton moved this task from Backlog to Doing on the Fundraising Sprint: justWork() board.

@KHaggard the ones that have gone up over the past few days should have the new number / name

Thanks. I'm meeting with Brian on Thursday to see if we can set a default field value for all non-donors to have "Non Donor" segment/status and "1000" ids. I know we can do that for current records, but checking if we can make it default for every newly created contact.

Ok update from me, we can definitely do some cleanup in Acoustic so that:

  1. Existing records with no donation is updated with Status/Segment "Non Donor" 1000
  2. Newly created records that submit an RML form with no donation history go through an automation to label them as "Non Donor" on an ongoing basis.

@Eileenmcnaughton Please confirm this sounds good? Also, we decided on "Non Donor" as the label correct (not lowercase/not plural)?

Ok, I have one final update for this phab ticket. I have done two things:

  1. I've run a query for all the records that have no donations, and then set the donor_segment and donor_status fields to "Non Donor" and set the corresponding id fields to "1000".
  2. I've set up an automated program in Acoustic that functions to select any RML sign-up that doesn't have an existing donation and apply default fields values "Non Donor" and "1000" for donor_segment, donor_segment_id, donor_status, and donor_status_id.

I believe all work for this ticket is now complete. Resolving this ticket now but feel free to notify me if there's any other pending tasks around this.