Page MenuHomePhabricator

Disable/delete old contribution_tracking module
Open, Needs TriagePublic

Description

Pretty sure we are done with this - it's still enabled on prod but I think it can be disabled

@JMando - you don't refer to the old drupal.contribution_tracking anywhere anymore?

Related Objects

Event Timeline

Hey there. I still have one data cube that is referencing drupal.contribution_tracking. I will switch it to the new one this month and comment here when it is done if that is okay?

Maybe related question. Will drupal.exchange_rates still be active?

Thanks @JMando

There is no plan to change drupal.exchange_rates ... yet - although we do need to make one - good to know you use that table

AKanji-WMF added subscribers: Pcoombe, AKanji-WMF.

FYI @Pcoombe - do you still use this contribution tracking table?

Yes, I use that extensively. Didn't realise there was any desire to deprecate it.

I can also work on updating to use the new table this month, but there's quite a few scripts will need to be edited so it may take longer

Can you clarify: is utm_source going to remain available in the new table? I see it's there at the moment but T182030#8773967 mentions it only being available in the interim view. If it's going away, that will make things considerably more complicated

Also I assume tracking_date is the replacement for ts?

@Pcoombe there is no current plan to drop utm_source - although ideally it would be unnecessary as the data is separately broken out into other fields. I think it would be good if you can confirm the way/s in which you do find you still need to use if (for documentation purposes at the very least). tracking_date is the replacement for ts as you say.

There isn't a payment_method field as described in the other task, only payment_method_id and payment_submethod_id. What are those supposed to join to?

@Pcoombe the values are

 select v.value,v.label FROM civicrm_option_value v INNER JOIN
 civicrm_option_group g ON g.id = v.option_group_id WHERE g.name ='payment_metho
d';

and

select v.value,v.label FROM civicrm_option_value v INNER JOIN civicrm_option_group g ON g.id = v.option_group_id WHERE g.name ='payment_instrument';

Be warned that the value in the above queries is a string and in civicrm_contribution_tracking it is in integer - that can cause slow queries but you need to do that join I think @JMando has a way of casting the value in SQL that avoids the slow indexing issue

Change 993101 had a related patch set uploaded (by Pcoombe; author: Pcoombe):

[wikimedia/fundraising/analytics@master] Update test_tools to use civicrm.civicrm_contribution_tracking

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

Change 993101 merged by Pcoombe:

[wikimedia/fundraising/analytics@master] Update test_tools to use civicrm.civicrm_contribution_tracking

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

Okay, that's all the test_tools scripts updated, and I think I've done all the ad hoc queries in Google Sheets (e.g. for sidebar, app menu etc tracking)

That change to payment methods would require extensive rewriting, so I'm going to continue using utm_source.

If it helps, for payment_method name I do:

SELECT
    c.payment_instrument_id,
    cov.name AS payment_method,
FROM civicrm.civicrm_contribution AS c
LEFT JOIN civicrm.civicrm_option_value AS cov ON CAST(c.payment_instrument_id AS UNSIGNED) = CAST(cov.value AS UNSIGNED) AND CAST(cov.option_group_id AS UNSIGNED) = CAST(10 AS UNSIGNED)

And I have migrated over to civicrm.civicrm_contribution_tracking in the relevant scripts as well now. I still use drupal.exchange_rates though.

Thanks @JMando, that is helpful. However it would still require significant rewriting of some of the test results scripts, especially methods.py which we use for monitoring method popularity and conversion rates. I don't have time to undertake that at the moment.

Just noting that before fr-tech closes this ticket we should ensure we have comments in our code that tell us to check in with Peter before any changes to utm_source are made based on ^^

@JMando @Pcoombe - just flagging that I'm now actively starting to remove the drupal table - I believe you have gotten yourselves weened off it...

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

[wikimedia/fundraising/crm@master] Stop writing to contribution tracking table

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

Change 1002670 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Stop writing to contribution tracking table

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

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

[wikimedia/fundraising/crm@master] Update AdyenResolveTest to not interact with drupal contribution_tracking

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

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

[wikimedia/fundraising/crm@master] Fix Drupal contribution tracking lookup

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

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

[wikimedia/fundraising/crm@master] Fix wmf_audit to use a Civi::statics not a global

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

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

[wikimedia/fundraising/crm@master] Fix IngenicoResolveTest to not use fake contribution IDs

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

Change 1005620 merged by Cstone:

[wikimedia/fundraising/crm@master] Fix Drupal contribution tracking lookup

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

Change 1005633 merged by Cstone:

[wikimedia/fundraising/crm@master] Fix IngenicoResolveTest to not use fake contribution IDs

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

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

[wikimedia/fundraising/crm@master] Remove test code to delete drupal contribution tracking

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

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

[wikimedia/fundraising/crm@master] Remove BaseTestCase code to delete drupal contribution tracking

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

Change 1005640 merged by Eileen:

[wikimedia/fundraising/crm@master] Remove test code to delete drupal contribution tracking

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

Change 1005641 merged by Eileen:

[wikimedia/fundraising/crm@master] Remove BaseTestCase code to delete drupal contribution tracking

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

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

[wikimedia/fundraising/crm@master] Can the worm (remove more contribution tracking refs)

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

Change 1005642 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Can the worm (remove more contribution tracking refs)

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