Page MenuHomePhabricator

Null banner entries for "_ideal" banners/donations
Closed, ResolvedPublicBUG REPORT

Description

When querying for some NL banners (those that end in "_ideal," we noticed that the banner column is populated with nulls. In chatting with the team, it looks like the trigger has an IF condition and only includes rows where the utm_source has 2 dots, while the "_ideal" donations have three dots.
Example Query

SELECT
	c.id id,
    DATE(c.receive_date) as date,
    DATE_FORMAT(c.receive_date, '%Y-%m-%d %H:00:00') AS hourly_timestamp,
    HOUR(c.receive_date) as hour,
    country.iso_code,
    country.name AS country,
    s.banner,
    t.utm_source,
    c.total_amount AS total_amount
FROM civicrm.civicrm_contribution as c
LEFT JOIN drupal.contribution_tracking AS t ON c.id = t.contribution_id
LEFT JOIN drupal.contribution_source AS s ON t.id = s.contribution_tracking_id
LEFT JOIN civicrm.civicrm_address AS a ON (c.contact_id = a.contact_id AND a.is_primary = 1)
LEFT JOIN civicrm.civicrm_country AS country ON a.country_id = country.id
WHERE c.receive_date >= '2022-07-01'
    AND c.financial_type_id <> 14
    AND c.contribution_status_id = 1
    AND t.utm_medium = 'sitenotice'
    and t.utm_source='B2223_0830_nlNL_dsk_p1_lg_ctr_RemovedForLast5_optIn1.no-LP.rtbt.rtbt_ideal';

Event Timeline

Change 829073 had a related patch set uploaded (by Ejegg; author: Ejegg):

[wikimedia/fundraising/crm@master] Move contribution_source population into code

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

Change 830232 had a related patch set uploaded (by Ejegg; author: Ejegg):

[wikimedia/fundraising/crm@master] Update contribution_source backfill for iDEAL

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

XenoRyet triaged this task as Unbreak Now! priority.Sep 6 2022, 6:34 PM

Change 829073 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Move contribution_source population into code

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

Change 830232 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Update contribution_source backfill for iDEAL

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

Dwisehaupt changed the subtype of this task from "Task" to "Bug Report".Sep 7 2022, 4:29 PM

OK, the fix is deployed and the last million or so rows of missing data have been backfilled (should cover at least the last year of iDEAL donations). The new code seems to be making the contribution_source rows correctly.