Skip to content

add phone number support to reddit-conversions-api #2834

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akhsueh
Copy link
Contributor

@akhsueh akhsueh commented Mar 26, 2025

A summary of your pull request, including the what change you're making and why.

Adding the support of passing phone numbers into the Reddit Conversions API destination (destinations/actions-reddit-conversions-api).

We have configured it to the following default mapping, please let us know if this is not the correct default value from Segment that we should use:

default: {
  '@if': {
    exists: { '@path': '$.properties.phone' },
    then: { '@path': '$.properties.phone' },
    else: { '@path': '$.context.traits.phone' }
  }
}

Testing

  • [ X] Added unit tests and they have passed
  • [X ] Tested end-to-end using the local server / Actions Tester and checked the final payload in the request that was being sent
  • [ X] [If destination is already live] Tested for backward compatibility of destination: didn't notice any issues in the unit tests or end to end test using actions tester
  • [Segmenters] Tested in the staging environment
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

@@ -195,7 +195,8 @@ function getUser(
user_agent: clean(user.user_agent),
uuid: clean(user.uuid),
data_processing_options: getDataProcessingOptions(dataProcessingOptions),
screen_dimensions: getScreen(screenDimensions?.height, screenDimensions?.width)
screen_dimensions: getScreen(screenDimensions?.height, screenDimensions?.width),
phone_number: user.phone_number

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phone number requires treatments similar to email address with sanitizing and hashing before sending over to reddit-conversions-api. Here is a screenshot on the API doc suggesting the necessary steps on phone number processing.

Screenshot 2025-04-02 at 5 56 59 PM
It can be referenced back in "Hashing phone numbers" section under https://ads-api.reddit.com/docs/v2/#section/Prerequisites-and-considerations.

Also a note on testing the new processing function to verify different phone number variants are yielding the same hashed hex value for convergency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants