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

Tailored Audience for v4 #180

Merged
merged 3 commits into from
May 17, 2019

Conversation

esakai
Copy link
Contributor

@esakai esakai commented Dec 20, 2018

This is an implementation for Twitter Ads API v4 endpoints for tailored audiences.

  • POST accounts/:account_id/tailored_audiences
  • POST accounts/:account_id/tailored_audiences/:tailored_audience_id/users

Tests are not available yet.

@esakai
Copy link
Contributor Author

esakai commented Dec 20, 2018

@jbabichjapan
It would be great if you could review this pull request. Thank you in advance.

@jbabichjapan
Copy link
Contributor

Thanks so much for this - @tushdante will be reviewing this and also has been preparing the rest of the support for v4 - I think it would be good to align the checkin so that the other functionality doesn't break when we upgrade the API_VERSION from 3 to 4

# @since 4.0
#
# @return [TailoredAudience] The newly created tailored audience instance.
def create_instance(account, name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given that v4 will no longer support TON based audiences, I'd suggest removing this method in favor of editing the existing create method instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tushdante

There is a concern. The signatures of these two methods are totally different.

create(account, file_path, name, list_type)
create_instance(account, name)

If I made a method like create(account, name), the backward compatibility would be broken. Is this OK with you? If so, I would simply drop the current create method and rename create_instance to create.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good point! I think it should be fine to just drop the current create method and rename the create_instance to create, given that the current create method will no longer be supported as of v4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tushdante Thank you for your comment. I understand. I will modify the code as you mentioned.

# @since 4.0
#
# @return success_count, total_count
def users(params)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add @param params [JSON object] A hash containing the list of users to be added/removed/updated as a comment to describe the input format

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tushdante
Thank you for your comment. I will add it.

@@ -3,7 +3,7 @@

module TwitterAds

API_VERSION = '3'.freeze
API_VERSION = '4'.freeze
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets leave this as 3 for now, given that this change will break all deprecated endpoints. We'll make the change once all the other v4 changes have been merged.

@tushdante tushdante mentioned this pull request Jan 3, 2019
@tushdante
Copy link
Collaborator

Left a couple comments @esakai ! Let me know if there's any additional questions. The changes should be simple enough and once we've merged this PR we can make the change to v4.

@eccyan
Copy link

eccyan commented Jan 30, 2019

How's this PR going?

@esakai
Copy link
Contributor Author

esakai commented Jan 31, 2019

I have already implemented all parts I was requested to change. I am waiting for @tushdante 's review.

@treby
Copy link
Contributor

treby commented Mar 4, 2019

It seems the code conflicts with master.
@esakai do you plan to resolve that?

@esakai esakai force-pushed the tailored-audience-for-v4 branch from 6f46aec to 9b0ffd1 Compare March 4, 2019 08:10
@esakai
Copy link
Contributor Author

esakai commented Mar 4, 2019

@treby

Thank you for your notice.
I have just rebased this branch on the master branch so that the conflict can be resolved.

There is one more suggestion.
I think that TwitterAds::TailoredAudience.memberships is no longer needed.
Do you want me to delete the method?
If you wish to do so, you can delete it yourself.
Please let me know your thoughts.

@treby
Copy link
Contributor

treby commented Mar 4, 2019

I think that TwitterAds::TailoredAudience.memberships is no longer needed.

I think so too.
According to twitter, version 3 of the Ads API reached end of life on February 28, 2019.

The document for the API is no longer available, too.
https://developer.twitter.com/en/docs/ads/audiences/api-reference/real-time

I can't decide the scope of this PR (Maybe @jbabichjapan or @tushdante - gem maintainers can), but just in my opinion both of the way (below) are ok.

  • option 1: First merge this PR, remove outdated feature on other PR
  • option 2: Including outdated feature removal on this PR, and review & merge

To maintainers, what do you think?

@smaeda-ks
Copy link
Collaborator

@treby @esakai Thanks. As you noticed, some of the old Audience endpoints are no longer work in v5 and there are even more lines to be removed. We will take care that part in another PR, so let's freeze this PR for now and merge it as it's been a while since created last year. Though, thank you for your patience :)

cc: @tushdante

@treby
Copy link
Contributor

treby commented Mar 14, 2019

@esakai I think this PR is ready to merge (Perhaps you need to follow master branch :) ).
Do you have any works for this PR before merging it?

@esakai esakai force-pushed the tailored-audience-for-v4 branch from 005ca25 to a5bff88 Compare March 14, 2019 06:22
@esakai
Copy link
Contributor Author

esakai commented Mar 14, 2019

@treby
Thank you for your reminder.
I have just rebased this branch on twitterdev:master branch.
I have already done everything.
You can merge this branch to the master branch now.

@esakai
Copy link
Contributor Author

esakai commented Apr 9, 2019

I think that this pull request should be merged because all the problems are solved now. I am wondering why this pull request is still open.

@bugcloud
Copy link
Contributor

What is the blocker of this PR??

@smaeda-ks smaeda-ks merged commit f15d7fa into xdevplatform:master May 17, 2019
@smaeda-ks
Copy link
Collaborator

@esakai @treby @bugcloud This is now merged. Again, thanks for your contribution!

smaeda-ks added a commit that referenced this pull request Jun 14, 2019
* Support for media library, media creative and account media endpoints (#185)

* Bump version to v4 (#186)

* make error handling image be shown (#177)

* update twitter-ads version to 4.0.1 (#187)

* Fix Rubocop Rules (#189)

* update twitter-ads version to 4.0.1

* update rubocop.yml and tailored_audience.rb

* Update to v5 (#191)

* Added support for MEDIA_CREATIVE stats

* added support for card_uris

* updated example for v5

* updated TC line_item_id to line_item_ids

* added support for with_draft

* remove preview_url from all cards endpoints

* Tailored Audience for v4 (#180)

* Add a comment to TailoredAudience.users

* Rename create_instance to create

The current create method will no longer be supported
as of v4.

* Delele unused methods

* Add (start|end)_time property to LineItem class #178 (#193)

* Remove TONUpload class (#192)

* Update SDK to support Ruby 2.3+ (#190)

* Remove CI guards

* Start upgrade to min 2.3. Rubocop auto fixes

* Disable and update a handful of Rubocop warnings

Disabled Linting warnings on using Void and URI:Escape

* Update copyright

* Test ruby 2.3+ on Travis CI

* Add Ruby 2.6 to build matrix and correct copyright lint

* Minor fix to copyright

* Add rubocop as separate step to display errors

* Make rubocop verbose to help debugging

* Remove erroneous newline

* Fix merge conflicts

* Revert "Remove CI guards"

This reverts commit 85db938.

* Update supported Ruby versions and bump license year

* Update LICENSE

* Fix merge conflicts

* Add ActiveEntities support (#195)

* Add ActiveEntities support

* Update style

* Add new preview endpoint support (#194)

* Minor bug fixes (#197)

* Fix promoted_tweet example

* Fix TypeError

> no implicit conversion of nil into Hash (TypeError)

when with_deleted is false

* Improve Travis CI Tests (#196)

* Update .travis.yml

* Update README

We no longer test JRuby since #133

* Set min version to 2.4

* Allow bundler 2

* Update .rubocop.yml

* Update twitter-ads version to 5.1.0 (#198)

* [docs] updating v5.1.0 documentation
smaeda-ks pushed a commit to esakai/twitter-ruby-ads-sdk that referenced this pull request Jun 18, 2019
* Add a comment to TailoredAudience.users

* Rename create_instance to create

The current create method will no longer be supported
as of v4.

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

Successfully merging this pull request may close these issues.

7 participants