Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M.me links with referral parameter don't work for first-time users #17

Closed
rubycalling opened this issue Jun 5, 2019 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@rubycalling
Copy link

rubycalling commented Jun 5, 2019

Describe the bug

When a first-time user click on a m.me link including a referral parameter and/or scan a QR code containing this type of link, they won't enter the expected curation flow, instead they will receive the NUX messages.

To Reproduce

Steps to reproduce the behavior:

  1. Click on https://m.me/OriginalCoastClothing?ref=SUMMER_COUPON
  2. Land on the Get Started page
  3. Click the Get Started button
  4. Observe that you receive the welcome message

Expected behavior

Instead of receiving the default welcome message that is usually triggered with the Get Started flow, you should get the summer coupon.

Additional context

The issue happen because we aren't reading the ref parameter value in the postback event:

{
  "sender":{
    "id":"<PSID>"
  },
  "recipient":{
    "id":"<PAGE_ID>"
  },
  "timestamp":1458692752478,
  "postback":{
    "payload":"<USER_DEFINED_PAYLOAD>",
    "referral": {
      "ref": "ref_data_in_m_dot_me_param",
      "source": "SHORTLINK",
      "type": "OPEN_THREAD",
    }
  }
}

See docs: https://developers.facebook.com/docs/messenger-platform/discovery/m-me-links#reading_parameter

@rubycalling rubycalling added the bug Something isn't working label Jun 5, 2019
facebook-github-bot pushed a commit that referenced this issue Jul 2, 2019
Summary:
This completes the fix for #17, the issue is that PR #19 was missing one usecase.

#### Current behavior

When visiting: https://m.me/OriginalCoastClothing?ref=summer_coupon

First time users get:
This is a default postback message for payload: summer_coupon!

Returning customers would get the coupon

#### Description

On V1 we decided to convert all referral payloads to uppercase.
https://github.com/fbsamples/original-coast-clothing/blob/v1.0/services/receive.js#L159

PR #19 added the capacity to get first time user payloads but did not gave them the same uppercase treatment. This PR adds that consistency so that the same payload produces the same result.
Pull Request resolved: #25

Test Plan:
On my staging server:
https://m.me/303005080360340?ref=summer_coupon

The payload was successfully parsed as SUMMER_COUPON
![Screenshot 2019-07-01 14 33 57](https://user-images.githubusercontent.com/2464679/60468064-448b5280-9c0d-11e9-8f82-260951898b56.png)

{F164839634}

Reviewed By: virtuallyawake

Differential Revision: D16080384

Pulled By: jorgeluiso

fbshipit-source-id: 6988377caa35bb9f4f392df7e11cdd5a52f53204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants