Как стать счастливее и уверенно идти к своим целям? Все ответы — в книге «Сам себе государство. Как совершить революцию в жизни». Купить Store Visit Custom Audiences - Marketing API - Documentation - Facebook for Developers

Store Visits Custom Audiences

Create a custom audience of users who visited a store. See Custom Audience, Targeting.

Once you create a custom audience with customer store visits data, reference it in ad targeting as you do with standard custom audience. Facebook automatically updates this audience based on the retention policy you setup.

If your business locations are eligible for store visits reporting, and you have at least 10 measurable business locations set up, you can potentially create a Custom Audience based on people on Facebook who have visited your locations.

Store Visit Custom Audiences may not contain all Facebook users that have visited your physical location. Only people that our systems have confidently identified to have visited the location will be present within the audience.

Store Visit Custom Audience Eligibility

Access to the Store Visits Custom Audience Eligibility API endpoint is provided to a select group of developers. Please contact your partner manager for access.

To check if your store location/page is eligible to create Store Visit Audiences use the following API call:

curl -G \
  -d "access_token=<ACCESS_TOKEN>" \
  https://graph.facebook.com/<API_VERSION>/<PARENT_PAGE_ID>/store_visits_custom_audiences_eligible_countries

The call above provides a list of countries that eligible for Store Visits Custom Audiences. The combination of this parent page and each country in this list would be an eligible store visit chain.

Create a Custom Audience

To create a custom audience using this method, the account needs to have already accepted the Terms of Service for Custom Audiences in Ads Manager.

To create a custom audience from your store visits:

curl 
  -F 'name=My Store Visits Custom Audience' 
  -F 'prefill=1' 
  -F 'rule={"inclusions":{"operator":"or","rules":[{"retention_seconds":2592000,"event_sources":[{"id":"<PAGE_ID>","type":"store_visits"}],"filter":{"operator":"and","filters":[{"operator":"=","field":"event","value":"store_visit"},{"operator":"=","field":"store_visit_country","value":"US"}]}}]}}'
  -F 'access_token=ACCESS_TOKEN' 
  https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customaudiences

This returns the id of the audience upon success. These parameters are most relevant for custom audiences based on your customer visits in your store:

Name Description

name

type: string

Required.

Name of the cluster

description

type: string

Optional.

Description of the cluster

rule

type: string

Required.

Audience rules to be applied on the referrer URL.


Note: Store Visit Custom Audience rule syntax differs from other Custom Audience endpoints prior to v2.11. See the Audience Rules section.

prefill

type: boolean

Optional.

  • true—Includes website traffic recorded prior to the audience creation.

  • false—Only includes website traffic beginning at the time of the audience creation.

Audience Rules

A custom audience for Store Visits Custom Audiences must contain an audience rule. Each rule must be provided as a JSON-encoded string. See Audience Rules for complete information. See also:

  • Audience Rule Syntax
  • Rule Set Syntax
  • Inclusion/Exclusion Rule Syntax: Under event_sources, set id to your store's Page ID and type to store_visits.
  • Filters
  • Filter Rules:
    • Under field, specify event or store_visit_country.
    • Under value, if the field attribute is set to event the value must be set to store_visit. If the field attribute is set to store_visit_country the value must be set to two letter ISO country code (e.g. US).
  • Aggregate Functions: Only the count aggregation function is available for Store Visit Custom Audiences.

Example Store Visit Custom Audience Rules

Rule Description
{
  "inclusions": {
    "operator": "or",
    "rules": [
      {
        "retention_seconds": 2592000,
        "event_sources": [
          {
            "id": "<PAGE_ID>",
            "type": "store_visits"
          }
        ],
        "filter": {
          "operator": "and",
          "filters": [
            {
              "operator": "=",
              "field": "event",
              "value": "store_visit"
            },
            {
              "operator": "=",
              "field": "store_visit_country",
              "value": "US"
            }
          ]
        }
      }
    ]
  }
}

Customers visited your store in the last 30 days in the US.

{
  "inclusions": {
    "operator": "or",
    "rules": [
      {
        "retention_seconds": 2592000,
        "event_sources": [
          {
            "id": "<PAGE_ID>",
            "type": "store_visits"
          }
        ],
        "filter": {
          "operator": "and",
          "filters": [
            {
              "operator": "=",
              "field": "event",
              "value": "store_visit"
            },
            {
              "operator": "=",
              "field": "store_visit_country",
              "value": "US"
            }
          ]
        },
        "aggregation": {
          "type": "count",
          "operator": ">",
          "value": 1
        }
      }
    ]
  }
}

Aggregation Example: Customers visited your store in the last 30 days more than one time in the US.

{
    "inclusions": {
        "operator": "or",
        "rules": [
            {
                "event_sources": [
                    {
                        "id": "<PAGE_ID>",
                        "type":"store_visits"
                    }
                ],
                "retention_seconds": 2592000,
                "filter": {
                    "filters": [
                        {
                            "field": "event",
                            "operator": "=",
                            "value": "store_visit"
                        }
                    ]
                }
            }
        ]
    },
    "exclusions": {
        "operator": "or",
        "rules": [
            {
                "event_sources": [
                    {
                        "id": "<PAGE_ID>",
                        "type": "store_visits"
                    }
                ],
                "retention_seconds": 2592000,
                "filter": {
                    "operator": "and",
                    "filters": [
                        {
                            "field": "event",
                            "operator": "=",
                            "value": "store_visit"
                        },
                        {

                           "field": "store_visit_country",
                           "operator": "=",
                           "value": "US"

                        }
                    ]
                }
            },
            {
                "event_sources": [
                    {
                        "id": "<PAGE_ID>",
                        "type": "store_visits"
                    }
                ],
                "retention_seconds": 2592000,
                "filter": {
                    "operator": "and",
                    "filters": [
                        {
                            "field": "event",
                            "operator": "=",
                            "value": "store_visit"
                        },
                        {

                            "field": "store_visit_country",
                            "operator": "=",
                             "value": "GB"
                        }
                    ]
                }
            }
        ]
    }
}

Exclusion Example: All Customers who visited your store excluding US and UK customers.