Understanding Lytics / Integrations


Link Lytics to your Facebook marketing to target your ads to Lytics audiences.


  1. Before you can build a custom audience in Facebook, you must agree to the Facebook Custom Audience Terms.

  2. After you have agreed to Facebook's terms, navigate to the Facebook integration in the Integrations section of Lytics.


  3. Navigate to Authorizations.

  4. Select which type of authorization to create. Facebook supports two kinds of authorizations: Facebook user auth, or a Business Manager System User auth.

    • Facebook User auth will guide you through a Oauth process to authorize access to ad accounts tied to that particular Facebook user. Using Oauth is fast and simple, but can be prone to failure in the long run as authorizations can be cancelled if the user changes their password, leaves the org, and some other auth invalidating event.
    • Business Manager System User auth is not tied to a specific user, so it is more reliable in the long-term and is valid until revoked in the Business Manger settings. This is the recommended authentication method if possible. See the detailed steps below to auth get a System User token.
  5. If setting up a Facebook user auth, you will be prompted to login to facebook and grant permissions. You will then need to enter a description for your authorization. facebook oauth description

  6. If setting up a Business Manager System User auth, you will be prompted to input an Access Token and Description. See creating a Facebook system user for instructions on obtaining an access token. Screenshot from 2018-12-03 16-41-31

  7. Click Authorize to save the authorization.

Creating a Facebook System User

Before creating a system user, your Facebook Business Manager must:

  • Have an admin user.
  • Own a Facebook app. You should claim the app and associate it with a business via API or in Business Manager. To see your apps, visit the Facebook Apps page.

Once you satisfy these requirements, go to Business Settings and complete the following steps.

  1. Under Users click System Users.
  2. Click +Add to create a new system user. fb add system user
  3. Give a name to the system user and click Create System User. create system user
  4. Assign ad accounts as an asset by selecting Ad Accounts. fbassignasset Then select the ad accounts that you would like to push Lytics Audiences to. fb add ad account
  5. Next you'll need to generate a token that'll be entered into Lytics to make API calls with. To start this, select Generate New Token.
  6. Select your Facebook app and make sure to give it ads management access. fb generate token
  7. The generated token will be only shown once, copy this token and paste it into the Access Token text input in step 6 of the authentication process.

Target Known Users With Facebook Custom Audience

Export a Lytics audience to Facebook. Changes are batched to save API calls. See API Limits for details on Facebook's API limits.

Exports toFacebook audience
NameLytics + audience name, or custom
Identifiersemail, name, Facebook ID, first name, last name, gender, city, state, zip, county, phone
Mapped Fieldsno
Audience Exportsselected audience
Typeadd & remove

You may have a Lytics audience you want to use as a Custom Audience. This audience can be used within Facebook as a target, a suppression group, or as a seed for a lookalike audience.

NOTE: Custom Audiences in Facebook consist of known users only. When selecting a Lytics audience to use from this export. Make sure the audience is made up of known users (users who have an email address).

  1. Navigate to the Facebook integration in the Integrations section of Lytics. facebook
  2. Select the Export Audience workflow.
  3. Select the authorization you created in the authentication step.
  4. Configure your export to include the Ad Account ID you want, the audience with known users, and any other required fields:

    • Facebook Ads Account ID: Select the Ads account you wish to export audiences to. If it says "must accept Custom Audiences Terms" next to the Ads Account ID, you must accept the Facebook custom audiences terms of service for that account before you can begin exporting.
    • Audience: Select an audience of known users (users with an email address) to be exported as a custom audience.
    • Email Field: Select the user field which represent's the user's email in your account.
    • Audience Source: Select whether data was collected directly from customers, directly from partners, or from both.


  5. (Optional) Toggle the advanced options for more configuration settings.

    • SHA256 Email: Select a user field containing the SHA256 hash of the user's email address.
    • Audience Name: Enter the name of the custom audience you would like to create in Facebook.
    • Audience Description: Enter the description of the custom audience you would like to create in Facebook.
    • Opt-out Link: Opt-out link to be used for the audience in Facebook.
    • Existing Users: When checked, Lytics will export existing users to the custom audience in addition to new incoming users. This option is selected by default.
    • User Fields: You can choose to export a number of additional user fields to Facebook, including:
      • First Name
      • Last Name
      • Gender
      • City
      • State
      • Zip
      • Country
      • Phone
    • Lifetime Value: Selecting a lifetime value field will change the list from a normal custom audience to a value-based custom audience. See Advertiser help center: Customer Lifetime Value for more information on value-based custom audiences.
  6. Click Start Export, and the custom audience should be immediately visible in Facebook in your Audiences. It is important to note that Facebook takes time to match the audience to their users. In most cases, the audiences is available for advertising / suppression / lookalikes within 10-60 minutes.


Create a Lookalike Audience with Facebook Ads

  1. Follow the steps on targeting known users With Facebook custom audience to export a Lytics audience to Facebook.

  2. After you have exported your audience to Facebook, navigate to Create Audience > Lookalike Audience in the Facebook Ads Manager. create

  3. Complete the required fields:

    • Source: Select the audience to replicate.
    • Country: Select the country to target.
    • Optimize for: Optimize for more similarity or a larger reach.
  4. Click Create Audience.

  5. The new audience will now be available for you to target.

Target Anonymous Users with Facebook Ads

Anonymous audiences can only be shared on pages where both the Lytics tag and Facebook pixel are placed.

  1. If you have not already, add the Facebook pixel to your website. See Facebook's documentation for assistance adding the Facebook pixel and adding the Facebook pixel using Google Tag Manager.

  2. After you have added the tag to your site, you will need to enable API access for the audiences you would like to target.

  3. Verify that that Facebook is receieving Lytics Audiences. You can use the Facebook Pixel Helper Chrome extension to help verify this: facebook pixel helper

  4. Navigate to the Facebook integration in the Integrations section of Lytics. facebook

  5. Select the Create Web Traffic Audiences workflow.

  6. Select the authorization you created in the authentication step.

  7. Fill out the required fields:

    • Facebook Ads Account ID: select your Facebook ads account ID from the dropdown.
    • Pixel: select you Facebook pixel ID from the dropdown.


  8. (Optional) Toggle the advanced options for more configuration settings.

    • Audiences: select which audiences you want to export. If none are selected, all audiences that are API enabled will be exported by default.
  9. Click Start Export to begin the export. This takes data collected from the Facebook pixel and creates Lytics audience rules on that data that can be used by Facebook web traffic audiences.

  10. Now navigate to Audiences within the Facebook ads manager.

  11. Create a Custom Audience from Web Traffic. app

  12. From the dropdown labeled All website visitors, select Lytics Audiences. custom

  13. Search for the API-enabled audience ID you want to target and adjust your lookback window.


  14. Set the audience to contains to true. You can also add a second audience if you would like to target multiple audiences.

  15. Name the audience and click Create Audience.


You are all set to target these users with Facebook Ads. You can also build a lookalike audience based on these users. See instructions on Creating a Lookalike Audience with Facebook Ads above.