Mixpanel Community Icon

how can I access with MCP for mixpanel to group data?

how can I access with MCP for mixpanel to group data?

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

    Hi Juan I., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> 👋

    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
    ·
    ·

    I'll help you understand how to access group data with Mixpanel's Python SDK (which I assume is what you mean by "MCP").To work with Group Analytics in Mixpanel using the Python SDK, you need to follow these steps: 1. First, make sure you have Group Analytics enabled and configured in your Mixpanel project settings.2. To track events with group data, you can use the Python SDK like this: ```mp = Mixpanel('YOUR_PROJECT_TOKEN')

    Track an event and attribute it to a group

    mp.track('sample_distinct_id', 'some_event', { 'Plan Type': 'Premium', 'company': 'mixpanel' # 'company' is the group_key, 'mixpanel' is the group_id })LBKSLBKS3. To set group profile properties: LBKSLBKSmp = Mixpanel('YOUR_PROJECT_TOKEN')

    Create or update a group profile

    mp.group_set('company', 'mixpanel', { 'Company Type': 'Analytics', '$name': 'Mixpanel' })LBKSLBKS4. There are additional group profile methods available: LBKSLBKS

    Set properties only if they don't exist yet

    mp.group_set_once('company', 'mixpanel', { 'location': 'us', })

    Remove a property from a group profile

    mp.group_unset('company', 'mixpanel', [ 'employee_count' ])

    Add unique values to a list property

    mp.group_union('company', 'mixpanel', { 'features': ['data pipeline', 'alerts'] })

    Remove specific values from a list property

    mp.group_remove('company', 'mixpanel', { 'features': ['alerts'] })```For more details on these methods, you can check the Mixpanel Python SDK documentation.Remember that Group Analytics is a paid add-on for Enterprise or Growth plans, so make sure your account has access to this feature.

    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.

  • Avatar of Juan I.
    Juan I.
    ·
    ·

    how do I list with a curl call all my group ids id? kapa.ai

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

    Let me check the knowledge base for you again. One moment! 📚

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

    To list all your group IDs in Mixpanel using a curl call, you can use the Engage API with the appropriate parameters for group data. Here's how to do it: You'll need to use the Engage API endpoint with the data_group_id parameter to export Group Profiles. The data_group_id corresponds to your group key.LBKScurl --request POST \ --url [https://mixpanel.com/api/query/engage](https://mixpanel.com/api/query/engage) \ --header 'Authorization: Basic YOUR_BASE64_ENCODED_API_SECRET' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data 'project_id=YOUR_PROJECT_ID' \ --data 'data_group_id=YOUR_DATA_GROUP_ID'LBKSYou can find your data_group_id in two ways: 1. In your Project Settings under the Group Keys section 2. In the URL of your Group Profile page, which looks like: [https://mixpanel.com/project/<project_id](https://mixpanel.com/project/<project_id) /view/<workspace_id> /app/profile#distinct_id=<distinct_id> &amp;data_group_id=<data_group_id>> The response will contain a JSON object with your group profiles in the "results" key, where each profile contains the group ID as the "$distinct_id" value.Export Methods: Export raw data and reports from Mixpanel provides more details on exporting profile data, including group profiles.Note that you may need to paginate through the results if you have many group profiles, as the API returns a limited number of profiles per request.

    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.