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

Expose actions and action_values for Facebook Ads? #1

Closed
andrewstautz opened this issue Mar 29, 2018 · 7 comments
Closed

Expose actions and action_values for Facebook Ads? #1

andrewstautz opened this issue Mar 29, 2018 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@andrewstautz
Copy link

Hi -
First of all, this is great work! I think lots of people are going to get some good use out of it.

I've spent the day trying to modify your code to expose the "actions" and "action_values" fields on the "insights" edge of the Facebook Marketing API.
(I use Facebooks "Offline Conversions" tool, and those results are stored in actions/action_values)

The trouble I'm having is that those fields return a list (or an array? in any case, not a single value) that doesn't play nice with the navigation steps you have happening after the main request loop. If I comment out those navigation steps, and just return the "list" variable, things look all right for a second, but then the query throws a "400: Bad Request" error if I try to filter on any of the expanded action_values items.

A github user named Hugoberry has a repository with a simpler Facebook Ads connector that just spits out a JSON - which works better (insofar as it tries to do less) with the actions and action_values responses. But his script can't handle big requests because it doesn't have the pagination handling that yours does.

Unfortunately, I don't know enough M to tinker with the main list.combine/list.accumulate step that you use to handle big requests, so I haven't come up with a way to combine the two approaches.

Long story short, if this is still a project in active development, I think it'd be really cool if you could add the functionality needed to expose "actions" and "action_values" in the Facebook Ads Insights connector.

Or, if you've got any hints for me, I can keep working toward it as well, and I can share my code with you/other users.

Thanks,
Andrew

@mbilling
Copy link
Owner

mbilling commented Mar 30, 2018 via email

@mbilling
Copy link
Owner

mbilling commented Apr 1, 2018

I took a look at the changes you need.
If was easy for me to add the actions column list (and expanding, pivoting etc. in to separate columns for each action). But it became apparent to me when adding the action_values list column that when these are empty they are difficult to handle without cluttering up the M steps afterwards.
I think it's a better approach to take out these lists in separate tables since PBI is excellent at combining them. The only hurdle here is that PBI doesn't do multicolumn key relations. So we need to add a composite text column containing date, ad_id, adset_id and campaign_id.
Now PBI will automatically relate these tables (if not disabled in the PBI settings).
One advantage with this method is it that other users of the connector take out the level of detail they need. One can skip taking out actions and action_values if you don't need them - taking less time to extract from FB.

I can't exactly break-down in my head if my proposed solution should be cause to some obstacles when making calculated measres/columns in DAX.
Any thoughts?

@andrewstautz
Copy link
Author

andrewstautz commented Apr 2, 2018 via email

@mbilling
Copy link
Owner

mbilling commented Apr 4, 2018

Thanks, sounds like we're on the same page.
I'll add the new tables and the key binding them all.

@mbilling mbilling self-assigned this Apr 6, 2018
@mbilling mbilling added the enhancement New feature or request label Apr 6, 2018
@mbilling mbilling closed this as completed Apr 6, 2018
@mbilling
Copy link
Owner

mbilling commented Apr 6, 2018

Let me hear what you think :)

@andrewstautz
Copy link
Author

Hi -

Wanted to let you know that I've seen this!
Thanks for doing it!

Right now I'm hitting rate limits with the actions and action values queries - I'm still troubleshooting to see if it's a local problem with the ad accounts I'm trying to look at, or if it's something that's going to affect users more generally.

The original two queries - ad insights and active ad insights - both seem to function well. Maybe I'm just under my limits with those queries and the trouble starts because the actions/action values return more data per call? Maybe I'll filter to the specific actions I need?
Another thing I'm trying is reducing the date preset from lifetime to 90 days, 14 days, etc, to see if that helps.

Ideally I can get this figured out without resorting to batched or asynchronous requests. I'll post here with what I can come up with.

-AS

@mbilling
Copy link
Owner

mbilling commented Apr 9, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants