Closed Bug 1073118 Opened 10 years ago Closed 10 years ago

F.M.O - "Live Version" Visualizations - Country Breakdown Graph

Categories

(Mozilla Foundation Communications :: Website, task)

x86
macOS
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mavis, Assigned: gvn)

References

Details

(Whiteboard: [EOYFR2014][studio mofo][f.m.o][nov28][p1])

Attachments

(1 file)

Visualization design for country breakdown graph.

Note that we should take responsive design and localization limitation into consideration.
I added Adam to this bug.

Adam offered the possibility that this visualization could use country data gathered by Google Analytics:

"If we don't have country info from PayPal, we can present the 'donations by country' data from GA as a fall-back plan." - Adam

Q for Adam: How accurate are the country data if we went this route? 

The other option is the PayPal API, but i'm not sure you can grab country data through the API. Needs to be checked out. Mavis you have access to the PayPal sandbox / API right? Is this something you can check?
(In reply to Andrea Wood from comment #1)
> Q for Adam: How accurate are the country data if we went this route? 

An interesting statistical feature of this is it will show the geolocation based on IP address of where the donations are made FROM (where in the world the donor is sitting at that point in time). Whereas the payment detail in PaylPal will show the BILLING ADDRESS of the donors. 

The geolocation data in GA is plenty good enough for this use case.
If we choose to use PayPal data does that mean all the BSD transactions will be excluded?

> The geolocation data in GA is plenty good enough for this use case.
Ditto.  What do you think, Andrea?
Flags: needinfo?(andrea)
yup, let's just use GA for sure. Hopefully that makes your life easier Mavis!
Flags: needinfo?(andrea)
Hey Andrea and Adam,

Just wanna share my assumption with you in case I'm totally off the track.

So we will
1) add GA to the "thank you for donating" page 
2) use GA API to get the country breakdown info

Adam, do I need to have a API key in order to make the call?  If so, how should I obtain one?

Thanks!
Flags: needinfo?(andrea)
Flags: needinfo?(adam)
Assignee: sabrina → mavis
Adam has the answer to this (not me) so clearing my needinfo.
Flags: needinfo?(andrea)
(In reply to Mavis Ou [:mavis] from comment #5)
> So we will
> 1) add GA to the "thank you for donating" page 
Correct :)

> 2) use GA API to get the country breakdown info
> 
> Adam, do I need to have a API key in order to make the call?  If so, how
> should I obtain one?

You don't need to write the API stuff from scratch, as we can add this data to an existing tool I have setup here: https://github.com/adamlofting/transformtogeckoboard

This tool is connected to the GA API via this code:
https://github.com/adamlofting/transformtogeckoboard/blob/master/lib/googleanalytics.js

And using code like this...
https://github.com/adamlofting/transformtogeckoboard/blob/master/lib/appmaker.js

...can query GA, and output the numbers we care about as an end point that you can call to get the data into FMO. Like this: http://transformtogeckoboard.herokuapp.com/appmaker/topremixes
Flags: needinfo?(adam)
Whiteboard: [EOYFR2014][studio mofo] → [EOYFR2014][studio mofo][f.m.o]
Blocks: 1065708
Whiteboard: [EOYFR2014][studio mofo][f.m.o] → [EOYFR2014][studio mofo][f.m.o][oct31]
* [oct31] is now past. Please update whiteboard to [nov14] or future train.
Whiteboard: [EOYFR2014][studio mofo][f.m.o][oct31] → [EOYFR2014][studio mofo][f.m.o][nov14][p1]
Adam, could you help verify that the GA code has been added to the thank you page?  I hope somewhere on the GA dashboard has this info. :)
Flags: needinfo?(adam)
If nothing shows up on GA yet could you paste the relevant code(if there's any) that needs to be added to the Thank You page?  Thanks!
Depends on: 1073100
Assignee: mavis → gavin
Interesting treatment by Wikipedia:
http://meta.wikimedia.org/wiki/Fundraising#mediaviewer/File:Donationmap.png

We should continue to break down by country on our chart (a more detailed view), but their breakdown by continent definitely simplifies things. Perhaps that could be the default view on our page, and then you can see detailed data by country on click or rollover? Not sure what exactly your design entails. Just sharing! Thought it was cool.
(In reply to Mavis Ou [:mavis] from comment #10)
> If nothing shows up on GA yet could you paste the relevant code(if there's
> any) that needs to be added to the Thank You page?  Thanks!

Aki has done some work on this, but the data isn't in GA yet so I think there's something we need to debug in the tracking script on the thank you page. I've re-opened the original bug for this: https://bugzilla.mozilla.org/show_bug.cgi?id=1013832

Also this is the link to the documentation for tagging donation pages:
https://wiki.mozilla.org/Foundation/Metrics/Landing_Page_Tracking#Donation_Pages_.28sendto.mozilla.org.29
Flags: needinfo?(adam)
(In reply to Adam Lofting (:adamlofting) from comment #12)
> Aki has done some work on this, but the data isn't in GA yet so I think
> there's something we need to debug in the tracking script on the thank you
> page. I've re-opened the original bug for this:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1013832
> 
> Also this is the link to the documentation for tagging donation pages:
> https://wiki.mozilla.org/Foundation/Metrics/
> Landing_Page_Tracking#Donation_Pages_.28sendto.mozilla.org.29

I filed a more specific bug for this work: 
* Bug 1100306 - Donation amount conversion tracking (GA and Optimizely)
Once the thank you pages are tagged with the GA eCommerce tags, the data for the graph(s) can be accessed:

BY COUNTRY
http://transformtogeckoboard.herokuapp.com/eoy/donationsbycountry

BY CONTINENT
http://transformtogeckoboard.herokuapp.com/eoy/donationsbycontinent
* [nov14] is past -- please update to [nov28] train or later
Whiteboard: [EOYFR2014][studio mofo][f.m.o][nov14][p1] → [EOYFR2014][studio mofo][f.m.o][nov28][p1]
Status: NEW → ASSIGNED
Depends on: 1103099
Adam, 

Just to clarify the data we want to use to feed the graph is "number of donors" by country and not "donation".  Sorry about catching this late :( Could you please adjust the code for us?  I hope GA can tell us this info!  But let me know if we need to place new GA track code in the "thank you" page etc.

Thank you!
Mavis
Flags: needinfo?(adam)
ah. i did not catch this either. i was thinking "donors" would read less "US-Centric" because all the amounts will be in USD and the US will account for 50% of all donations.

If it is hard to switch to # of donors, please continue with total donations. We'll adjust this next year.
No problem at all, I clearly missed that too!

Here are additional end-points:

http://transformtogeckoboard.herokuapp.com/eoy/transactionsbycountry

http://transformtogeckoboard.herokuapp.com/eoy/transactionsbycontinent
Flags: needinfo?(adam)
Attachment #8527279 - Flags: review?(gavin)
Comment on attachment 8527279 [details] [review]
GitHub PR - update endpoint url

Close, but needs a little tweaking. See GH! :)
Attachment #8527279 - Flags: review?(gavin) → review-
Attachment #8527279 - Flags: review- → review+
Merged.
Up on staging: fundraising2.mofostaging.net/

For any further issues, please file a separate bug.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
See Also: → 1104417
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: