Spreadfirefox affiliates: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 60: Line 60:
The idea is that logmaker.php tells us how much traffic went in, so we can set expectations for run.pl and the tally script.
The idea is that logmaker.php tells us how much traffic went in, so we can set expectations for run.pl and the tally script.
Another way to test the tally scripts might be to create a test-tally.sql which could have expected output after the tally code runs.
Another way to test the tally scripts might be to create a test-tally.sql which could have expected output after the tally code runs.
= Some thoughts by Paul Booker =
When we migrate to D6 it would be great if we could have the latest modifications to the affiliate program ported over to D6 as a satellite module to our "affiliates" module on drupal.org, submitting any generic features back to the affiliates project on drupal.org so that we can maintain the smallest amount of bespoke code in SVN. "Cleanliness of code" and "Correctness" have both been fine with the "affiliates" module since October. "Testability" improvements would be welcomed.

Revision as of 14:08, 16 April 2009

Go to the Spread Firefox wiki home

Go to Spread Firefox Affiliates program wiki home

Background

The Spread Firefox Affiliates program contributes to many Firefox downloads by giving community members HTML buttons to place on their website. Website visitors click these buttons, which leads to a destination site (e.g. the Firefox download page).

The sfx_affiliates module implements the various tools needed by the Affiliates program.

Version 2

With milestone 3.0, the sfx_affiliates module has been substantially rewritten.

Goals

The rewrite was done to accomplish a few things...

  1. Cleanliness of code, comments, and structure this makes it easier to make changes in the future,
  2. Correctness, i.e. points are counted correctly, aggregate stats are correct, etc
  3. Testability, this is an awkward system to test because it is spread out over many sites.
  4. Archiving. Another big problem with v1 was that we were always deleting records, so if we had a problem longer than a month ago, the only way to get at those records would be to re-parse/tally the logs for that day/week/month

Features

Buttons

Stats & Points

Current affiliates lists

  • Top 5
  • Top 250
    • Lists top 250 affiliates, sorted by the number of points each gained over the past 7 days.
  • Top Movers

Content

OG Project page

http://spreadfirefox.com/affiliates

Testing

Stats

Testing affiliates stats tracking requires a special setup because of the architecture. Currently, the stage site is not very useful for testing affiliates button traffic stats.

logmaker.php is a script that can generate fake access logs to be used for testing affiliates traffic. Hit/download count can be configured. Optionally, affiliate user/button data can be pulled from a database, which can be used to populate the fake access logs. Hits/downloads/points per user will be chosen randomly. The script will output the amount of hits/downloads/points per user ID it generated.

Example procedure:

  1. Configure logmaker.php
    1. Hit count: 15,000
    2. Download count: 12,500
    3. Pull top 250 users from existing DB
    4. Pull all active buttons from existing DB
  2. Run logmaker.php, save output
  3. Run run.pl, save output
  4. Save current top 250 page (screenshots?)
  5. Run SFx cron (which will run tally scripts)
  6. Compare previous to current top 250 (since logmaker.php used only the top 250 users to generate logs, only the top 250 affiliates will be affected, and you can view all changes on this page)

The idea is that logmaker.php tells us how much traffic went in, so we can set expectations for run.pl and the tally script. Another way to test the tally scripts might be to create a test-tally.sql which could have expected output after the tally code runs.