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

CustomAudience created via API can't be displayed in Facebook Ad Manager #55

Closed
seattlecyclist opened this issue Sep 4, 2018 · 4 comments

Comments

@seattlecyclist
Copy link

Hi,

I am creating a FB Custom Audience. It works fine but if I go to the FB Ad Manager and open the Audience and try to edit it. I get an error saying that the audience was created via the API and it can not show the details. I have attached my code and the error.

This seems like its so fundamental and googling for it results in no results for me, that I think something must be wrong. Is it possible to make a custom audience via an API and then edit OR even just view the rule details via FB Ads Manager

rule = {"inclusions":
          {"operator":"or",
           "rules": [
               {"event_sources":[
                   {"type":"pixel","id": pixel_id}
               ],
                "retention_seconds":2592000,
                "filter":{
                    "operator":"and",
                    "filters":[
                        {"operator":"or",
                         "filters":[
                             {"field":"url",
                              "operator":"i_contains",
                              "value":"lifting"
                             },
                             {"field":"url",
                              "operator":"i_contains",
                              "value":"Crossfit"
                             }
                         ]
                        }]
                },"template":"VISITORS_BY_URL"}]
          }
}


audience = @ad_account.customaudiences.create({ name: "Test Audience",
                                                prefill: true,
                                                rule: rule})

The error message from Facebook Ads Manager when I open the custom audience and try to edit it:

This rule was created through API or third party applications. It contains syntax that we currently don't support in our interface.
@seattlecyclist
Copy link
Author

Closing. Found this document. https://developers.facebook.com/ads/blog/post/2018/06/13/sharing-custom-audiences/
I need to provide the relationship_type

@shakeelm99x
Copy link

Hi @seattlecyclist,

Could you please provide me an example of how to provide "relationship_type"? Thank you

@TheTamFamily
Copy link

Hi @seattlecyclist,

Did you manage to view the rule that was set via API in the Audience Manager. After using the relationship_type I'm still unable to view the rule. Could you paste the json in this message.

Thanks,

David

@souldeux
Copy link

souldeux commented Aug 8, 2022

Hello, people of the past and future. If you're anything like me then this issue was one of the most useful results you found when searching for this error.

If you're anything like me, relationship_type was not the issue and your hope quickly dissolved.

My issue, which I also see in the initial code snippet, was providing event_sources but no filter that indicated which event I wanted to filter on from those sources.

"rules": [
   {"event_sources":[
       {"type":"pixel","id": pixel_id}
   ],
    "retention_seconds":2592000,
    "filter":{
        "operator":"and",
        "filters":[
            {"field": "event", "operator": "eq", "value": "PageView"}, # This is new!
            {"operator":"or",
             "filters":[
                 {"field":"url",
                  "operator":"i_contains",
                  "value":"lifting"
                 },
                 {"field":"url",
                  "operator":"i_contains",
                  "value":"Crossfit"
                 }
             ]
            }]
    },"template":"VISITORS_BY_URL"}]
}

I tinkered around with relationship_type along with several other fields I found mentioned elsewhere: sub_type and customer_data_source. Including them doesn't break anything, but it doesn't fix anything either (in my case, at least).

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

No branches or pull requests

4 participants