Closed Bug 969520 Opened 10 years ago Closed 10 years ago

Referrer tracking code on webmaker.org and tools

Categories

(Webmaker Graveyard :: Metrics, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adam, Assigned: cade)

References

Details

Attachments

(11 files)

55 bytes, text/x-github-pull-request
jon
: review+
Details | Review
54 bytes, text/x-github-pull-request
jon
: review+
Details | Review
48 bytes, text/x-github-pull-request
jon
: review+
Details | Review
55 bytes, text/x-github-pull-request
jon
: review+
Details | Review
60 bytes, text/x-github-pull-request
jon
: review+
Details
48 bytes, text/x-github-pull-request
jon
: review+
Details | Review
56 bytes, text/x-github-pull-request
jon
: review+
Details | Review
56 bytes, text/x-github-pull-request
jon
: review+
Details | Review
56 bytes, text/x-github-pull-request
jon
: review+
Details | Review
43 bytes, text/x-github-pull-request
jon
: review+
Details | Review
52 bytes, text/x-github-pull-request
jon
: review+
Details | Review
To help us better measure the impact of campaigns and partnerships, we should add referrer code tracking to webmaker.org, and the corresponding tools.

I suggest that the MVP for this is using an agreed URL parameter to set a referrer code (this is any arbitrary string), and hold onto this using a session variable or a cookie, and then store this in the database when a user signs up to create a new account. 

For example, user visits webmaker.org/?ref=ymca
Creates an account (maybe via popcorn maker or another tool)
Their account data would now include a "ref" field with the string stored.

This will allow us to query the database to understand which partnerships engage users on the day, and on an ongoing basis (i.e. who comes back to use the tools later?)

Building a practice of tagging particular campaigns will also give us a quick and easy way to segment and attribute traffic in Google Analytics.
We'll need to:

1) Add a referrer field in the wmlogin db. Should be a nullable string
2) Add some way of capturing the referrer, maybe store it in localStorage so that it isn't sent with every request to the domain
3) When account creation happens, send the referral code along with the request to create an account
Chris can we give this to you?
Assignee: nobody → cade
Status: NEW → ASSIGNED
Component: General → Metrics
QA Contact: brett
I was talking to Paula, and there is an event on 11 April that could be a first test case for this if it's possible to ship by then?
I think we can ship this before then. I'll start building it this week!
so, this updates the webmaker-auth-client so that if "ref=foo", foo will be set in localstorage as the referrer, and can be used if the user creates an account somewhere on the site later. It will fallback to simply looking for the ref attribute on create if the browser doesn't support localStorage.

This will not work if the user is sent to WM.Org with a referrer and then navigates to popcorn/thimble/goggles/events/login
\o/ thank you
Chris - could you please provide a complete sample URL so I don't make mistakes in creating the referrer URL for partners? Also, can I confirm that this will only work if the user creates an account at webmaker.org rather than x.webmaker.org?
here are some sample urls:

https://webmaker.org/?ref=mozilla

https://webmaker.org/teach?ref=mozilla

https://webmaker.org/teach?ref=mozilla

https://events.webmaker.org/#!/?ref=mozilla

https://popcorn.webmaker.org/?ref=mozilla

https://thimble.webmaker.org/project/952/remix?ref=mozilla

... Everywhere an account can be created will work once we update each app's version of the Webmaker Auth client library!

The gotcha here is that if the link sends the user to Thimble, the referrer value will be set in localStorage for thimbles domain *only*. This means that if they decide to explore by navigating to webmaker.org and then decide to create an account, that stored referrer value will not be applied on the creation step.

I have an idea to work around this, but I'm gonna run it by jon to see if it's a sane approach.
Thanks Chris - I will keep tracking it here and wait for your signal before I start setting up partners :)
Attachment #8397259 - Flags: review?(jon) → review+
This switches a cookie library that was previously being used out for the one I forked from node-cookie, so we don't get duplicate codez.

will need a version update for webmaker-auth-client when that is merged.
Attachment #8398603 - Flags: review?(jon)
Attachment #8397258 - Flags: review- → review?(jon)
Just a quick query to see how this is going?
Hey Paula - Sorry for the delay, Jon and I have been working on the engagement ladder stuff for measuring contribution.

All that's left here is to get the code reviewed, test it on staging, and then deploy it.
\o/ to both the engagement ladder/contribution measure and the referrer code. Thank you.
Comment on attachment 8397259 [details] [review]
https://github.com/mozilla/login.webmaker.org/pull/253

rebased and added a commit, lets re-review.
Attachment #8397259 - Flags: review+ → review?(jon)
Comment on attachment 8397259 [details] [review]
https://github.com/mozilla/login.webmaker.org/pull/253

r+ with one nit noted in the PR, just re-arranging some lines of code
Attachment #8397259 - Flags: review?(jon) → review+
* This is awesome. Let's follow up on this in Apr 23 Webmaker.org call. 

* @ Chris: once it lands, can you or JBuck write some basic documentation about it on the wiki?
* So that a) relevant staff know how to use it properly, and b) we're clear on what behaviors it will allow us to track, and which it won't?
Attachment #8397258 - Flags: review?(jon) → review+
That's an r+ with one nit in the PR
Attachment #8398603 - Flags: review?(jon) → review+
(In reply to Matt Thompson (@OpenMatt :OpenMatt) from comment #18)

> * @ Chris: once it lands, can you or JBuck write some basic documentation
> about it on the wiki?
Totally can!

> * So that a) relevant staff know how to use it properly, and b) we're clear
> on what behaviors it will allow us to track, and which it won't?
This patch won't provide any tools to get data automatically about referrers, but if we have an idea of the kind of tools we need we can build them in follow-up tickets.
This patch fixes webmaker-auth-client so that its require dependencies are properly loaded during the build step using the requirejs optimizer.
Attachment #8409719 - Flags: review?(jon)
Attachment #8409719 - Flags: review?(jon) → review+
update webmaker-auth-client version to 0.0.28
Attachment #8409729 - Flags: review?(jon)
Attachment #8409761 - Flags: review?(jon) → review+
Comment on attachment 8409729 [details]
https://github.com/mozilla/login.webmaker.org/pull/258

r-, I think we need to leave eventEmitter in there
Attachment #8409729 - Flags: review?(jon) → review-
Attachment #8409751 - Flags: review?(jon) → review+
Attachment #8409769 - Flags: review?(jon) → review+
Attachment #8409776 - Flags: review?(jon) → review+
Comment on attachment 8409751 [details] [review]
https://github.com/mozilla/webmaker.org/pull/691

fixed up the GH comments
Attachment #8409751 - Flags: review+ → review?(jon)
Comment on attachment 8409729 [details]
https://github.com/mozilla/login.webmaker.org/pull/258

did you accidentally r-?
Attachment #8409729 - Flags: review- → review?(jon)
Attachment #8409729 - Flags: review?(jon) → review+
Attachment #8409785 - Flags: review?(jon)
Attachment #8409785 - Flags: review?(jon) → review+
Attachment #8409751 - Flags: review?(jon) → review+
Attachment #8409729 - Attachment description: https://github.com/mozilla/login.webmaker.org/pull/258/files → https://github.com/mozilla/login.webmaker.org/pull/258
Attachment #8409729 - Attachment mime type: text/plain → text/x-github-pull-request
Attachment #8409791 - Flags: review?(jon) → review+
Blocks: 999513
This is working on our staging and production environments, documentation to be done in bug 999513 as soon as I can!
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: