r79187 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79186‎ | r79187 | r79188 >
Date:17:01, 29 December 2010
Author:rfaulk
Status:deferred
Tags:
Comment:
Updated the reporting sql to include amount50 fields.
Modified paths:
  • /trunk/fundraiser-statistics/reporting/banner_test.sql (modified) (history)
  • /trunk/fundraiser-statistics/reporting/banner_test_banners.sql (modified) (history)
  • /trunk/fundraiser-statistics/reporting/banner_test_by_banner.sql (modified) (history)
  • /trunk/fundraiser-statistics/reporting/banner_test_by_hour.sql (modified) (history)
  • /trunk/fundraiser-statistics/reporting/banner_test_by_lp.sql (modified) (history)
  • /trunk/fundraiser-statistics/reporting/custom_campaign_plot.php (modified) (history)
  • /trunk/fundraiser-statistics/reporting/ecomm_test.sql (modified) (history)
  • /trunk/fundraiser-statistics/reporting/ecomm_test_by_hour.sql (modified) (history)
  • /trunk/fundraiser-statistics/reporting/landing_page_test.sql (modified) (history)
  • /trunk/fundraiser-statistics/reporting/landing_page_test_by_hour.sql (modified) (history)

Diff [purge]

Index: trunk/fundraiser-statistics/reporting/banner_test_by_banner.sql
@@ -12,8 +12,10 @@
1313 donations / total_clicks as conversion_rate,
1414 round(donations / impressions,6) as don_per_imp,
1515 amount / impressions as amt_per_imp,
 16+amount50 / impressions as amt50_per_imp,
1617 donations / views as don_per_view,
17 -amount / views as amt_per_view
 18+amount / views as amt_per_view,
 19+amount50 / views as amt50_per_view
1820
1921
2022 from
@@ -59,7 +61,8 @@
6062 SUBSTRING_index(substring_index(utm_source, '.', 2),'.',1) as banner,
6163 count(*) as total_clicks,
6264 sum(not isnull(contribution_tracking.contribution_id)) as donations,
63 -sum(converted_amount) AS amount
 65+sum(converted_amount) AS amount,
 66+sum(if(converted_amount > 50, 50, converted_amount)) as amount50
6467 from
6568 drupal.contribution_tracking LEFT JOIN civicrm.public_reporting
6669 ON (contribution_tracking.contribution_id = civicrm.public_reporting.contribution_id)
@@ -70,6 +73,6 @@
7174
7275 on ecomm.banner = imp.utm_source and imp.dt_hr = ecomm.dt_hr and imp.dt_min = ecomm.dt_min
7376
74 -where impressions > 10000
 77+where impressions > 50000
7578
7679 group by 1,2 ;
Index: trunk/fundraiser-statistics/reporting/ecomm_test_by_hour.sql
@@ -6,7 +6,8 @@
77 count(*) as total_clicks,
88 sum(not isnull(contribution_tracking.contribution_id)) as donations,
99 sum(converted_amount) AS amount,
10 -sum(if(converted_amount > 100, 100, converted_amount)) AS modified_amount, -- truncates donations over 100
 10+sum(if(converted_amount > 50, 50, converted_amount)) as amount50,
 11+-- sum(if(converted_amount > 100, 100, converted_amount)) AS modified_amount, -- truncates donations over 100
1112 max(converted_amount) AS max_amt,
1213 sum(if(right(utm_source,2)='cc',1,0)) as cc_clicks,
1314 sum(if(right(utm_source,2)='cc' and contribution_tracking.contribution_id,1,0)) as cc_don,
Index: trunk/fundraiser-statistics/reporting/banner_test_by_lp.sql
@@ -7,9 +7,11 @@
88 total_clicks as clicks,
99 donations as donations,
1010 amount as amount,
 11+amount50 as amount50,
1112 donations / total_clicks as conversion_rate,
1213 donations / views as don_per_view,
13 -amount / views as amt_per_view
 14+amount / views as amt_per_view,
 15+amount50 / views as amt50_per_view
1416
1517
1618 from
@@ -33,7 +35,8 @@
3436 SUBSTRING_index(substring_index(utm_source, '.', 2),'.',-1) as landing_page,
3537 count(*) as total_clicks,
3638 sum(not isnull(contribution_tracking.contribution_id)) as donations,
37 -sum(converted_amount) AS amount
 39+sum(converted_amount) AS amount,
 40+sum(if(converted_amount > 50, 50, converted_amount)) as amount50
3841 from
3942 drupal.contribution_tracking LEFT JOIN civicrm.public_reporting
4043 ON (contribution_tracking.contribution_id = civicrm.public_reporting.contribution_id)
Index: trunk/fundraiser-statistics/reporting/banner_test_by_hour.sql
@@ -12,12 +12,16 @@
1313 total_clicks as clicks,
1414 donations as donations,
1515 amount as amount,
 16+amount50 as amount50,
1617 views / floor(impressions * views / views_banner) as click_rate_lp,
1718 donations / total_clicks as conversion_rate,
1819 round(donations / floor(impressions * views / views_banner) ,6) as don_per_imp,
19 -donations / views as don_per_view
 20+round(amount / floor(impressions * views / views_banner) ,6) as amt_per_imp,
 21+round(amount50 / floor(impressions * views / views_banner) ,6) as amt50_per_imp,
 22+donations / views as don_per_view,
 23+amount / views as amt_per_view,
 24+amount50 / views as amt50_per_view
2025
21 -
2226 from
2327
2428 (select
@@ -74,7 +78,8 @@
7579 utm_campaign,
7680 count(*) as total_clicks,
7781 sum(not isnull(contribution_tracking.contribution_id)) as donations,
78 -sum(converted_amount) AS amount
 82+sum(converted_amount) AS amount,
 83+sum(if(converted_amount > 50, 50, converted_amount)) as amount50
7984 from
8085 drupal.contribution_tracking LEFT JOIN civicrm.public_reporting
8186 ON (contribution_tracking.contribution_id = civicrm.public_reporting.contribution_id)
Index: trunk/fundraiser-statistics/reporting/landing_page_test_by_hour.sql
@@ -11,7 +11,7 @@
1212 donations / total_clicks as completion_rate,
1313 donations / views as don_per_view,
1414 amount / views as amt_per_view,
15 -modified_amount / views as amt_per_view_reduced,
 15+amount50 / views as amt50_per_view,
1616 max_amt,
1717 pp_don,
1818 cc_don,
@@ -42,7 +42,7 @@
4343 count(*) as total_clicks,
4444 sum(not isnull(contribution_tracking.contribution_id)) as donations,
4545 sum(converted_amount) AS amount,
46 -sum(if(converted_amount > 100, 100, converted_amount)) AS modified_amount, -- truncates donations over 100
 46+sum(if(converted_amount > 50, 50, converted_amount)) as amount50,
4747 max(converted_amount) AS max_amt,
4848 sum(if(right(utm_source,2)='cc',1,0)) as cc_clicks,
4949 sum(if(right(utm_source,2)='cc' and contribution_tracking.contribution_id,1,0)) as cc_don,
@@ -59,7 +59,7 @@
6060
6161 on ecomm.landing_page = lp.landing_page and ecomm.utm_campaign = lp.utm_campaign and lp.hr = ecomm.hr
6262
63 -where views > 10
 63+where views > 100
6464
6565 group by 1,2,3 order by 1,8 desc;
6666
Index: trunk/fundraiser-statistics/reporting/custom_campaign_plot.php
@@ -35,14 +35,10 @@
3636
3737 // generate plots
3838 $args = ' ' . $cmpgn . ' ' . $start;
39 -// $cmd = 'echo "baggin5" | sudo -S ./plot_build_latest.sh' . $args;
40 -$cmd = './plot_build_latest.sh' . $args;
 39+$cmd = '/home/rfaulk/fundraiser-statistics/bash/plot_build_latest.sh' ;
4140
42 -chdir('/home/rfaulk/fundraiser-statistics/bash/');
43 -
4441 // Execute the shell command
45 -//$output1 = shell_exec($cmd . ' 2>&1');
46 -//$output2 = shell_exec('whoami');
 42+chdir('/home/rfaulk/fundraiser-statistics/bash/');
4743 $output = shell_exec('echo ' . $cmd. $args . ' >async_plotter.sh');
4844
4945 echo '<html>';
Index: trunk/fundraiser-statistics/reporting/ecomm_test.sql
@@ -5,7 +5,8 @@
66 count(*) as total_clicks,
77 sum(not isnull(contribution_tracking.contribution_id)) as donations,
88 sum(converted_amount) AS amount,
9 -sum(if(converted_amount > 100, 100, converted_amount)) AS modified_amount, -- truncates donations over 100
 9+sum(if(converted_amount > 50, 50, converted_amount)) as amount50,
 10+-- sum(if(converted_amount > 100, 100, converted_amount)) AS modified_amount, -- truncates donations over 100
1011 max(converted_amount) AS max_amt,
1112 sum(if(right(utm_source,2)='cc',1,0)) as cc_clicks,
1213 sum(if(right(utm_source,2)='cc' and contribution_tracking.contribution_id,1,0)) as cc_don,
Index: trunk/fundraiser-statistics/reporting/banner_test.sql
@@ -15,8 +15,10 @@
1616 donations / total_clicks as conversion_rate,
1717 round(donations / floor(impressions * views / views_banner) ,6) as don_per_imp,
1818 round(amount / floor(impressions * views / views_banner) ,6) as amt_per_imp,
 19+round(amount50 / floor(impressions * views / views_banner) ,6) as amt50_per_imp,
1920 donations / views as don_per_view,
20 -amount / views as amt_per_view
 21+amount / views as amt_per_view,
 22+amount50 / views as amt50_per_view
2123
2224
2325 from
@@ -70,7 +72,8 @@
7173 utm_campaign,
7274 count(*) as total_clicks,
7375 sum(not isnull(contribution_tracking.contribution_id)) as donations,
74 -sum(converted_amount) AS amount
 76+sum(converted_amount) AS amount,
 77+sum(if(converted_amount > 50, 50, converted_amount)) as amount50
7578 from
7679 drupal.contribution_tracking LEFT JOIN civicrm.public_reporting
7780 ON (contribution_tracking.contribution_id = civicrm.public_reporting.contribution_id)
Index: trunk/fundraiser-statistics/reporting/landing_page_test.sql
@@ -13,7 +13,6 @@
1414 donations / views as don_per_view,
1515 amount / views as amt_per_view,
1616 amount50 / views as amt50_per_view,
17 -modified_amount / views as amt_per_view_reduced,
1817 max_amt,
1918 pp_don,
2019 cc_don,
@@ -43,7 +42,6 @@
4443 sum(not isnull(contribution_tracking.contribution_id)) as donations,
4544 sum(converted_amount) AS amount,
4645 sum(if(converted_amount > 50, 50, converted_amount)) as amount50,
47 -sum(if(converted_amount > 100, 100, converted_amount)) AS modified_amount, -- truncates donations over 100
4846 max(converted_amount) AS max_amt,
4947 sum(if(right(utm_source,2)='cc',1,0)) as cc_clicks,
5048 sum(if(right(utm_source,2)='cc' and contribution_tracking.contribution_id,1,0)) as cc_don,
@@ -60,7 +58,7 @@
6159
6260 on ecomm.landing_page = lp.landing_page and ecomm.utm_campaign = lp.utm_campaign
6361
64 -where views > 100
 62+where views > 1000
6563
6664 group by 1,2,3 order by 8 desc;
6765
Index: trunk/fundraiser-statistics/reporting/banner_test_banners.sql
@@ -63,6 +63,6 @@
6464
6565 on ecomm.banner = imp.utm_source
6666
67 -where impressions > 10000
 67+where impressions > 50000
6868
6969 group by 1,2 order by 10 desc;

Status & tagging log