Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Show a count of emails written on the homepage (or per candidate?!) #39

Open
andylolz opened this issue Mar 23, 2015 · 6 comments
Open

Comments

@andylolz
Copy link
Collaborator

I can track the number of CVs uploaded… But that number doesn’t change very quickly (at the moment, anyway.) Seeing the number of people writing letters is probably going to be more motivating for prospective letter writers.

Also, if we store figures per candidate, we can compute various badger stats! (e.g. average number of emails before CV upload).

This isn’t currently tracked… But I suppose we could start tracking the count and do:

  • total emails written since date

Or alternatively:

  • x emails sent to this candidate since date
@symroe
Copy link
Contributor

symroe commented Mar 23, 2015

Other stats to think about:

  • n people in this constituency have asked.
  • No one has been asked in these constituencies

@frabcus
Copy link
Owner

frabcus commented Mar 25, 2015

Can you think of a good technical way to store this?

Given currently my only writeable store is S3 :)

Main requirement is 1) can count per candidate, 2) can efficiently get the numbers back out again at page render time (maybe with a big cache).

@garethrees
Copy link

SimpleDB might be a good candidate if you're already using AWS stuff

@frabcus
Copy link
Owner

frabcus commented Mar 27, 2015

Looks good! @symroe can I have a SimpleDB key :)

@frabcus
Copy link
Owner

frabcus commented Mar 28, 2015

My plan is to use Google Analytics events for this.

Using gapy you can get the events out like this:

events = client.query.get(analytics_view_id, 
    datetime.datetime(2005, 1, 1), datetime.datetime.now(),
    ["totalEvents"], ["eventCategory", "eventAction"] 
)

I can do that on a separate cron job and write out as on JSON file somewhere for in app reporting.

@frabcus
Copy link
Owner

frabcus commented Mar 28, 2015

Hmmm, just found myself not recording my own events... Because I'm using uBlock.

Should I be doing this server side via PYGA or similar?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants