Audience segmentation and ingestion for InMobi DSP

InMobi DSP’s (Demand-side platform) Segment Creation API enables advertisers to transfer their audience to InMobi DSP with minimal manual intervention. Data ingestion significantly improves campaign targeting by leveraging the InMobi DSP Data Science models along with your audience.

You can configure the TTL (Time-to-Live) values, which determine how long your audience data remains in the DSP.You can use the integration to target your audience positively and negatively on the InMobi DSP.

The process starts with integrating your server with InMobi DSP and creating the audience segment on the DSP. After the segment creation, you have to ingest those audience data into the DSP. You can do the segment ingestion in two ways:

  • Single-user ingestion: Uses a GET endpoint to create a single user on InMobi DSP. This ingestion process ingests one user at a time and is not recommended for large groups of audiences. 
  • Batch ingestion: Uses a POST endpoint to transfer the bulk audience data stored in a compressed CSV file (.csv.gz) with a maximum file size of 10 MB.

After completing the segment ingestion, you can target the audience through InMobi DSP.  For any queries regarding the integration process, contact the InMobi team.

Pre-requisites

Ensure you have an active account with the InMobi DSP.

Create Audience Segment on InMobi DSP

Before ingesting your audience segment in your InMobi DSP account, you must integrate the DSP Segment Creation API into your server. The integration automatically creates the audience segments on your DSP account.

Follow the steps to create an audience segment on InMobi DSP:

  1. Use the following API URL to start creating the audience segment on InMobi DSP:http://advertiser.inmobiapis.com/tpce/v1/segment?segmentName=&propertyId=&membershipTtl=<MEMBER_SHIP_TTL_IN_DAYS>.
  2. Replace the value of the following API parameters with the required values:
    • SEGMENT_NAME: Refers to the name of your audience segment. The value should be in all capitals with no space and special character.
    • INMOBI_ADVERTISER_ID: Refers to the advertiser ID assigned to you by InMobi.
    • MEMBER_SHIP_TTL_IN_DAYS: Refers to the TTL for user IDs tagged to the audience segment. The value should be a number.
  3. Check the API response. The response should be as follows:

    {
        "status": "OK",
        "message": "success",
        "code": 200,
        "segmentId": "64d9e0bb-ad9c-4235-8b6e-2d1e6ad40cb3"
    }
    
    Value Data type Description
    OK String The API call was processed without any error.
    success String Message for successful integration.
    200 Number Refers to the https status code.
    64d9e0bb-ad9c-4235-8b6e-2d1e6ad40cb3 String The ID of the segment created in the InMobi DSP
  4. Confirm with your InMobi Account Manager if the audience segment is visible on the DSP dashboard.

Ingest Segment Data to InMobi DSP

After you create the audience segment on the InMobi DSP, you can ingest your audience data to the DSP in two ways:

Single-user ingestion

Single-user ingestion uses a GET endpoint to create a single user on InMobi DSP. Follow the steps to implement the Real-time DSP Ingestion:

  1. Use the following API for the single-user ingestion: http://advertiser.inmobiapis.com/tpce/v1/usersegment?propertyId=&gpId=&segmentIds=&action=&ida=<ios_device_id></ios_device_id>
  2. Replace the following API parameters with the required values:
    • INMOBI_ADVERTISER_ID: Refers to the advertiser ID assigned to you by InMobi.
    • ANDROID_DEVICE_ID: Refers to your advertiser GPID. This parameter is applicable only if you are targeting Android devices.
    • SEGMENT_ID: Refers to the ID of the audience segment.
    • ACTION: Adds or deletes the data from the InMobi DSP. Enter add or delete based on the requirement.
    • IOS_DEVICE_ID: Refers to your advertiser IDA. This parameter is applicable only if you are targeting IOS devices.
  3. Check the API response. The response should be as follows:
    {
        "status": "OK",
        "message": "success",
        "code": 200,
    }
    
    Key Value Data type Description
    status OK String The API call was processed without any error.
    message success String Message for successful API call.
    code 200 Number Refers to the https status code.
  4. Confirm with the InMobi team if the audience segment data are visible on the DSP dashboard. The data should be visible on the dashboard after 2-3 hours once you complete the ingestion steps.

Batch ingestion

Batch ingestion uses a POST endpoint to transfer the data stored in a compressed CSV file (.csv.gz) with a maximum file size of 10 MB. The file name format is filename.csv.gz, with no space between the words if the filename has more than one word. Follow the steps to implement the CSV file Ingestion:

  1. Use the following API for Batch ingestion of your audience data:
    curl -X POST -H 'Content-Type: multipart/form-data' -H 'Accept-Encoding: gzip' -H 'Content-Disposition: attachment; filename="@sample.csv.gz"' -H 'Content-Transfer-Encoding: binary' -F "file=@sample.csv.gz" -H 'User-Agent: python-requests/2.14.2' https://advertiser-content.inmobiapis.com/tpce/v1/upload/usersegment?propertyId=<inmobi_advertiser_id>&segmentNames=<segment_names>&segmentIds=<segment_ids>&action=<action> </action></segment_ids></segment_names></inmobi_advertiser_id>
    
  2. Replace the following API parameters with the required values:
    • INMOBI_ADVERTISER_ID: Refers to the advertiser ID assigned to you by InMobi.
    • SEGMENT_NAMES: Refers to the list of the segment names separated by semicolons. For example, Segment_1; Segment_2; Segment_3.
    • SEGMENT_IDS: Refers to the list of the segment IDs separated by semicolons. For example, SegmentID_1; SegmentID_2; SegmentID_3.
    • ACTION: Helps to add or delete the data from the InMobi DSP. Enter add or delete based on the requirement.
  3. Check the file ingestion API response. The response should be as follows:

    {
        "status": "OK",
        "message": "check the jobStatus via GET call of given jobUrl",
        "code": 200,
        "jobUrl": "https://advertiser-content.inmobiapis.com/tpce/v1/upload/jobs/file?job_id=sample.csv.gz_j2358cd64-63c0-4d8d-8104-5812dc09a5f2"
    }         

     

    Key Value Data type Description
    status OK String The API call was processed without any error.
    message  check the jobStatus via GET call of given jobUrl String Message for checking the status of the ingestion.
    code 200 Number Refers to the https status code.
    jobUrl https://advertiser-content.inmobiapis.com/tpce/v1/upload/jobs/file?job_id=sample.csv.gz_j2358cd64-63c0-4d8d-8104-5812dc09a5f2 String The URL to check the status of a job
  4. Check the job status by clicking the jobUrl value you get in step 3.
  5. Check the job status response. The response should be as follows:
    {
        "status": "OK",
        "message": "File processed successfully",
        "code": 200,
    }           

     

    Key Value Data type Description
    status OK String The API call was processed without any error.
    message File processed successfully String Message for successful job status check.
    code 200 Number Refers to the https status code.

    Note:

    If the propertyId or advertiserId used in the segment creation or segment ingestion is not InMobi DSP compliant, you may see the following error:

    {
        "status": "BAD_REQUEST",
        "message": "Invalid parameter(s) : Rejected due to error: CVM-X",
        "code": 1001,
        "segmentId": "-1"
    }       

     

  6. Confirm with the InMobi team if the audience segment data are visible on the DSP dashboard. It takes at least 24 hours to reflect the audience data on the DSP after execution.

On This Page

Last Updated on: 16 Oct, 2024