MozillaFoundation / foundation.mozilla.org

Mozilla Foundation website
https://foundation.mozilla.org
Mozilla Public License 2.0
388 stars 152 forks source link

[SPIKE] Establish Attribution chain for donations when they come from petitions #10847

Closed mtdenton closed 1 year ago

mtdenton commented 1 year ago

We need to figure out how to mark a donation as coming from Petitions when someone comes from a petition page and successfully donates on the FRU modal.

The goal of the ticket is to list out some concrete steps to establish attribution using the Salesfore Campaign ID as the source of truth.

Timebox: 1 hour

danielfmiranda commented 1 year ago

After taking a look at the new petition set up, it appears that the button which is used to render the FRU form is defined in the file petition-thank-you.jsx.

In this file, the "Thanks, Ill Chip in" button is set to link to the relative URL ?form=donate with no other parameters.

I believe this is the reason that any donations made using through this flow are having the UTM parameters stripped.

I think we can solve this through the following steps:

Tagging @mtdenton to take a look and let me know if it looks like I'm missing anything. 👍 thanks!

mtdenton commented 1 year ago

That sounds perfect @danielfmiranda , but I would maybe add one thing: If UTM parameters are present in the page's URL, how hard would it be to grab those with JS from window.location.href and append them to the back of the CTA's URL? So you would end up with something like:

?form=donate&campaign_id=xxxxxxxxx&utm_campaign=whatever&utm_xxx.....

Here's a FRU doc article that reinforces that thinking. Lots of browsers will strip that UTM info (as they should) but some will carry forward attribution into FRU's GA integration. Let me know what you think!

mtdenton commented 1 year ago

Also noting that to avoid creep on this approach, we could take the UTM JS part and create a separate ticket to be done later.

danielfmiranda commented 1 year ago

Thanks @mtdenton! I like the approach of implementing the first two tickets, and then implementing your request in a separate ticket to bring it all together (after taking a look at the code, I think your request will take a couple of hours as it appears I am going to need to make a small update to the backend as well.)

I have made this ticket to capture the work https://github.com/MozillaFoundation/foundation.mozilla.org/issues/10888 and will get to it as soon as I finish the other two. Thanks!

danielfmiranda commented 1 year ago

Since we have everything spelled out for implementation, I am going to close this spike ticket.