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

Add updateHandler to Actions DV360 #1726

Merged
merged 3 commits into from
Nov 29, 2023
Merged

Conversation

marinhero
Copy link
Contributor

@marinhero marinhero commented Nov 16, 2023

This PR adds the updateHandler that backs both addToAudience and removeFromAudience actions so users can use the bulk uploader endpoint to push users into their user lists.

API DOCS -> https://developers.google.com/authorized-buyers/rtb/bulk-uploader

Testing

Testing completed successfully in localhost and via unit test.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [Segmenters] Tested in the staging environment

@marinhero marinhero force-pushed the display-video-bulk-uploader branch from 37551ae to 725cfbd Compare November 17, 2023 02:54
@marinhero marinhero changed the title Display video bulk uploader Add updateHandler to Actions DV360 Nov 17, 2023
@@ -301,6 +301,7 @@ function setupRoutes(def: DestinationDefinition | null): void {
if (Array.isArray(eventParams.data)) {
// If no mapping or default mapping is provided, default to using the first payload across all events.
eventParams.mapping = mapping || eventParams.data[0] || {}
eventParams.audienceSettings = req.body.payload[0]?.context?.personas?.audience_settings || {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes the local actions tester to work with bulk and audiencesettings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Protobuf is added so we can work with Google's proto file

@marinhero marinhero marked this pull request as ready for review November 17, 2023 02:59
@marinhero marinhero requested a review from a team as a code owner November 17, 2023 02:59
@marinhero marinhero requested a review from a team November 17, 2023 02:59
@marinhero marinhero mentioned this pull request Nov 17, 2023
3 tasks
Copy link
Contributor

@maryamsharif maryamsharif left a comment

Choose a reason for hiding this comment

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

Great work! Left one comment but it's not blocking.

return new InvalidAuthenticationError(message, ErrorCodes.INVALID_AUTHENTICATION)
}

if (code === 501) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this error necessary since it would get caught in the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes because we don't want to retry 501's

// @generated from file dmp.proto (syntax proto2)
/* eslint-disable */
// @ts-nocheck

Copy link
Member

Choose a reason for hiding this comment

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

What is this file used for? I'm probably missing where it's imported, but where is it used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/segmentio/action-destinations/pull/1726/files#diff-bf64f369244ebd2563fb495496d0b39f0c0e1d7c46abd700a8c4cdefc2d744f4R10

These object/types help us serialize and deserialize objects in a way the bulk uploader understands.

@@ -39,6 +39,9 @@
},
"dependencies": {
"@amplitude/ua-parser-js": "^0.7.25",
"@bufbuild/buf": "^1.28.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

are these additions intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I need this package to handle the protobuf file I included in this same PR.

Copy link
Contributor

@LLuque-twilio LLuque-twilio left a comment

Choose a reason for hiding this comment

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

BXP veteran 🪄

@joe-ayoub-segment joe-ayoub-segment merged commit 6db1308 into main Nov 29, 2023
7 checks passed
@joe-ayoub-segment joe-ayoub-segment deleted the display-video-bulk-uploader branch November 29, 2023 11:54
Munter added a commit to bucketco/segment-action-destinations that referenced this pull request Nov 29, 2023
…nation

* segment/main: (59 commits)
  Publish
  attempting to fix breaking buildkite CI
  registering 1flow and jimo web Integrations
  Publish
  create trackEvent and identifyUser browser-destinations for 1flow (segmentio#1703)
  fix(Jimo): resolve when jimo is not an array & remove manualInit from settings (segmentio#1740)
  fix for empty string in setting (segmentio#1734)
  Yahoo audiences 5 (segmentio#1742)
  [STRATCONN] Klaviyo AddToProfileList and RemoveFromProfileList actions with engage setup (segmentio#1723)
  Add updateHandler to Actions DV360 (segmentio#1726)
  Inc-7055 long term fix: add external ids to message tags (segmentio#1744)
  Channels-973: parse text field of action buttons (segmentio#1738)
  LR: Fix CSV generator to account for all rows (segmentio#1735)
  [STRATCONN-3376] Add phone number to TikTok Audiences (segmentio#1730)
  rename full_name to display_name to fix API changes (segmentio#1743)
  adding default paths for click id and cookie (segmentio#1729)
  [Hyperengage] Resolved issue with Timezone Offset and Added Missing user_id field in group call (segmentio#1733)
  adding updated generated types for moengage
  Added key value pair of new regional endpoint (segmentio#1727)
  v3.89.0 (segmentio#1725)
  ...
@joe-ayoub-segment
Copy link
Contributor

Hi @marinhero this PR has been deployed

marinhero added a commit that referenced this pull request Nov 30, 2023
* Add updateHandler to Actions DV360

* Fix tests

* update yarn.lock
harsh-joshi99 added a commit that referenced this pull request Dec 6, 2023
commit 12d62f7
Author: Harsh Joshi <[email protected]>
Date:   Wed Dec 6 10:29:30 2023 +0530

    cleanup

commit 3b8b9ed
Author: Harsh Joshi <[email protected]>
Date:   Mon Dec 4 10:36:54 2023 +0530

    Code changes and unit tests

commit 2edb75e
Merge: 8e9e776 ad48899
Author: Harsh Joshi <[email protected]>
Date:   Wed Nov 29 18:01:45 2023 +0530

    Merge branch 'STRATCONN-3399' into klaviyo-add-to-profile-batch

commit 8e9e776
Author: Elena <[email protected]>
Date:   Wed Nov 29 04:02:37 2023 -0800

    Yahoo audiences 5 (#1742)

    * new audience settings, logging

    * mapping change, device type

commit 7b0fe44
Author: Ankit Gupta <[email protected]>
Date:   Wed Nov 29 17:25:49 2023 +0530

    [STRATCONN] Klaviyo AddToProfileList and RemoveFromProfileList actions with engage setup (#1723)

    * AddToProfileList and RemoveFromProfileList action added

    * added new flow of addProfileToList and RemoveProfileFromList actions in klaviyo

    * completed audience setup for klaviyo

    * updated api key field for klaviyo

    * change in remove from list api test cases

    * full audience sync turned off for audience klaviyo

    * changing default path of external_id

    * Removed debug codes

    * code refactored

    * change in addProfile and removeProfile in klaviyo

    * Resolved build error

    * Resolved build error

    * Added buildHeaders function

    * Seperated addProfile and RemoveProfile Functions

    * Added audience desctiption

    * Change error handling of createProfile function

    * Change error handling of createProfile function

    * Modified in addProfileToList Test case

commit 6db1308
Author: Marín Alcaraz <[email protected]>
Date:   Wed Nov 29 03:54:19 2023 -0800

    Add updateHandler to Actions DV360 (#1726)

    * Add updateHandler to Actions DV360

    * Fix tests

    * update yarn.lock

commit ac78bc7
Author: alfrimpong <[email protected]>
Date:   Wed Nov 29 05:50:15 2023 -0600

    Inc-7055 long term fix: add external ids to message tags (#1744)

    * feat: add external id type & value to message tags

    * feat: add test to enforce passthrough

commit 31e207c
Author: alfrimpong <[email protected]>
Date:   Wed Nov 29 05:44:38 2023 -0600

    Channels-973: parse text field of action buttons (#1738)

    * feat: parse merge tags in action button text

    * chore: added unit test

commit 593b024
Author: Sayan Das <[email protected]>
Date:   Wed Nov 29 17:14:02 2023 +0530

    LR: Fix CSV generator to account for all rows (#1735)

    * Fixed CSV generator to account for all rows

    * Updated CSV processor, tests and snapshots

commit ce3c082
Author: maryamsharif <[email protected]>
Date:   Wed Nov 29 03:43:21 2023 -0800

    [STRATCONN-3376] Add phone number to TikTok Audiences (#1730)

    * Add phone number

    * Fix unit tests

    * Hide enable batching field + adjust names

commit 6fc66be
Author: Chris Brown <[email protected]>
Date:   Wed Nov 29 06:42:32 2023 -0500

    rename full_name to display_name to fix API changes (#1743)

    * rename full_name to display_name to fix API changes

    * Update full_name to display_name in tests

commit 10cc239
Author: Joe Ayoub <[email protected]>
Date:   Wed Nov 29 12:42:06 2023 +0100

    adding default paths for click id and cookie (#1729)

commit 5d80f5e
Author: zhadier39 <[email protected]>
Date:   Wed Nov 29 16:41:16 2023 +0500

    [Hyperengage] Resolved issue with Timezone Offset and Added Missing user_id field in group call (#1733)

    * Add unit and integration tests

    * Updated field descriptions for group, identify and track

    * Updated common fields

    * Fix identify function error

    * Added authentication endpoint

    * Revise tests to enable auth

    * Update default paths for groupId.

    * Implement recommended changes from PR #1621

    * Add url field

    * Resolve pathing issues and add tests/checks for first and last name fields

    * Resolve test issues, payload validation error, and correct context default

    * Fix no user_id field in group call and timezone offset bug

    * Add tests for new functionality

    * Delete packages/destination-actions/src/destinations/liveramp-audiences/audienceEnteredSFTP.types.ts

    Remove auto generated types file on liveramp platform

    * Fix ts error with timeZoneName

    ---------

    Co-authored-by: saadhypng <[email protected]>
    Co-authored-by: Saad Ali <[email protected]>

commit ad48899
Author: Harsh Joshi <[email protected]>
Date:   Wed Nov 29 15:54:05 2023 +0530

    Update error handling

commit e9f2370
Author: Harsh Joshi <[email protected]>
Date:   Fri Nov 24 11:42:37 2023 +0530

    Add enable batching

commit a75cedd
Author: Harsh Joshi <[email protected]>
Date:   Fri Nov 24 11:06:45 2023 +0530

    Add performBatch in upsert profile
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.

6 participants