goodbotai / karma

Experience sampling bot
BSD 2-Clause "Simplified" License
7 stars 0 forks source link

Save referrals in the survey #109

Closed urbanslug closed 6 years ago

urbanslug commented 6 years ago

When the bot is initally shared and a user clicks on get started we record the referrer's RapidPro contact UUID in the referee's contact. However, we broke the bot into 3 surveys, instead of one long one, with the ability to share the bot at the end of each survey. We however don't have a way of knowing which survey of the 3 within the bot that the share link is from.

We need to find a way to save this data in every submission to Ona.

Important

The referral link can only take one param in the query string, ref. https://developers.facebook.com/docs/messenger-platform/discovery/m-me-links/#parameters

Implementation plan

  1. Concat the rapidpro user uuid with a survey identidier such as uuid_one and use this string as the value for ref
  2. Add a referrer_survey and referrer_uuid question to each XLSForm
  3. Add these values to the submission in Ona.