Mixpanel Community Icon

Integrating Advertising IDs into Mixpanel for Facebook Cohorts

·
·

kapa.ai

  • Matches based on device advertising IDs, such as:

  • GAID (Google Advertising ID) for Android devices.

  • IDFA (Identifier for Advertisers) for iOS devices.

  • FBID (Facebook Pixel ID) from website-based pixels.

  • Firebase Instance ID (FBID) for apps integrated with Firebase.

How to send them to Mixpanel in user profile so that we can use them in cohort in facebook

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Please stand by Aditya G. as I search the knowledge base. I normally take about 15 seconds or so. 👋

    Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    To send device advertising IDs to Mixpanel in user profiles for use in Facebook cohort exports, you need to store these IDs as user profile properties. This will allow you to use them when exporting cohorts to Facebook Ads.

    Storing Advertising IDs in User Profiles

    You can store advertising IDs (GAID, IDFA, FBID, etc.) as user profile properties using Mixpanel's profile update methods. Here's how to do it in different SDKs:

    In Python:

    initialize Mixpanel

    mp = Mixpanel('YOUR_PROJECT_TOKEN')

    set advertising ID as a profile property

    mp.people_set('sample_distinct_id', { 'ignore_time': True, '$ip': 0 })```Mixpanel SDKs: Python

    In Android:

    mixpanel.identify('12345', true);LBKS// Set the advertising ID as a profile property mixpanel.getPeople().set('advertising_id', 'gaid-1234567890');LBKS```LBKS[Mixpanel SDKs: Android](https://docs.mixpanel.com/docs/tracking-methods/sdks/android#storing-user-profiles)

    In iOS (Swift):

    Mixpanel.mainInstance().identify(distinctId: "12345")LBKS// Set the advertising ID as a profile property Mixpanel.mainInstance().people.set(properties: ["advertising_id": "idfa-1234567890"])LBKS```LBKS[Mixpanel SDKs: iOS (Swift)](https://docs.mixpanel.com/docs/tracking-methods/sdks/swift#storing-user-profiles)

    Using Advertising IDs for Facebook Cohort Export

    When setting up the Facebook Ads integration in Mixpanel: 1. Navigate to Integrations under the Data Management tab 2. Click on the Facebook Ads dropdown 3. When configuring the connection, select the user property where you're storing the device advertising ID 4. Complete the setup processWhen exporting cohorts to Facebook, Mixpanel will use the advertising IDs to match users in Facebook's system. Facebook will use these IDs along with other identifiers like email, phone number, or name to match users.As noted in the documentation:

    "Facebook uses email addresses to match users from the cohort with users from their system. If they do not have an email address, they will instead use either a combination of phone number or first and last name or the device advertising ID that you choose when setting up the connection."Facebook Ads IntegrationMake sure to consistently store the advertising IDs in the same user property that you selected during the Facebook Ads integration setup.Kapa AI: I noticed you're asking about sending device advertising IDs to Mixpanel. I've provided instructions on how to store these IDs in user profiles and use them for Facebook cohort exports. Is there anything specific about this process you'd like me to clarify further?

    kapa.ai is still learning and improving, please let me know how I did by reacting below.

    ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.