-
Notifications
You must be signed in to change notification settings - Fork 41
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
Quick Start Example #12
Comments
Hi @richzertuche , You should put exactly the content that Twitter returns to you in the authorization workflow. Anyway, I think you're right, ACCESS_TOKEN is made of a combination of the user-id and some code you should put it all together. Tell me if you have any issue with this. |
Thanks @hborras Yeap figured it out just about a few hours ago :\ Right now I'm trying to get the analytics for all my CAMPAIGNs, no luck yet, everything returns empty, CAMPAIGNs do appear. Thanks |
How are you making the requests? |
I changed: |
Well, I didn't implement that to campaigns due to the fact that twitter doesn't reccomend get stats at Campaign level. I'll check your code and I'll say something to you! |
Hi @richzertuche, I've tryed again analytics request and all is working perfect. With line items, with your option -> ['sort_by' => 'created_at-desc','count' => 5] and making granularity TOTAL instead of hour I get this response: `
) Doing the same with your code, what's a extension of mine. I get correct metrics and results: `Array
)
) Could you check that campaigns are you feching are active? |
To get the stats for the Campaings add a new fuction on Analytics.php as fallow ` public static function all_stats_campains(Account $account, $ids, $metricGroups, $params = [])
I just call all_stats_LineItem::campains insted of LineItem::all_stats andd it works fine, I did not see any warnings againts calling campaigns analytics on the Documentation on Twiiter API for version 1, but I could be wrong |
In this case, it's even easier, you only need to extend Campaign class to Analytics instead of Resource. That's what I meant when I say about Analytics requests and Best practices: https://dev.twitter.com/ads/analytics/best-practices Do request data (ideally) at the line_items and promoted_tweets level, as you can always aggregate and roll these metrics up to get totals across the entire ads entity hierarchy (i.e. for the campaign, funding instrument or account levels). But, since It could be a desired request, I'll implement it |
Closed since not response from @richzertuche |
Hi, following the quick-start example
It always returns forbidden, the application is already accepted by twitter ads and the user already authorized the app.
TWITTER_CONSUMER_KEY =xxxxxxxxxxxxxxxx
TWITTER_CONSUMER_SECRET =xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWITTER_ACCESS_TOKEN =user-id-xxxxxxxxxxxxxxxxx
TWITTER_ACCESS_TOKEN_SECRET =xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The curl request actually retrieves the accounts, is it right that the TWITTER_ACCESS_TOKEN is made up by user-id-xxxxxxxxxxxx or should be only the xxxxxxxxxxxxx
Thanks.
The text was updated successfully, but these errors were encountered: