Index: trunk/fundraiser-statistics/fundraiser-scripts/sql/report_LP_metrics.sql |
— | — | @@ -16,6 +16,11 @@ |
17 | 17 | donations / views as don_per_view, |
18 | 18 | amount / views as amt_per_view, |
19 | 19 | amount / donations as amt_per_donation, |
| 20 | +max_amt, |
| 21 | +pp_don, |
| 22 | +cc_don, |
| 23 | +pp_don / pp_clicks as paypal_click_thru, |
| 24 | +cc_don / cc_clicks as credit_card_click_thru |
20 | 25 | '%s %s %s %s %s %s %s %s %s %s %s %s' as effluent |
21 | 26 | |
22 | 27 | from |
— | — | @@ -38,7 +43,12 @@ |
39 | 44 | SUBSTRING_index(substring_index(utm_source, '.', 2),'.',-1) as landing_page, |
40 | 45 | count(*) as total_clicks, |
41 | 46 | sum(not isnull(contribution_tracking.contribution_id)) as donations, |
42 | | -sum(converted_amount) AS amount |
| 47 | +sum(converted_amount) AS amount, |
| 48 | +max(converted_amount) AS max_amt, |
| 49 | +sum(if(right(utm_source,2)='cc',1,0)) as cc_clicks, |
| 50 | +sum(if(right(utm_source,2)='cc' and contribution_tracking.contribution_id,1,0)) as cc_don, |
| 51 | +sum(if(right(utm_source,2)='pp',1,0)) as pp_clicks, |
| 52 | +sum(if(right(utm_source,2)='pp' and contribution_tracking.contribution_id,1,0)) as pp_don |
43 | 53 | from |
44 | 54 | drupal.contribution_tracking LEFT JOIN civicrm.public_reporting |
45 | 55 | ON (contribution_tracking.contribution_id = civicrm.public_reporting.contribution_id) |
Index: trunk/fundraiser-statistics/fundraiser-scripts/query_store.py |
— | — | @@ -176,6 +176,16 @@ |
177 | 177 | return 13
|
178 | 178 | elif metric_name == 'amt_per_donation':
|
179 | 179 | return 14
|
| 180 | + elif metric_name == 'max_amt':
|
| 181 | + return 15
|
| 182 | + elif metric_name == 'pp_don':
|
| 183 | + return 16
|
| 184 | + elif metric_name == 'cc_don':
|
| 185 | + return 17
|
| 186 | + elif metric_name == 'paypal_click_thru':
|
| 187 | + return 18
|
| 188 | + elif metric_name == 'creditcard_click_thru':
|
| 189 | + return 19
|
180 | 190 | else:
|
181 | 191 | return -1
|
182 | 192 | else:
|