User Interactions

User Interactions

An advertisement can have up to two buttons (a primary and secondary button). The touch buttons are configurable via the LOCALLY content management system. They can be set to perform an action such as opening up a URL, making a phone call, sending an email, opening a map, or playing a video

Via the LOCALLY content management system, you can also trigger these events by touching an ad image. You can transmit these ad interactions by calling the following API:

You need to pass in an Interaction JSON object in the following format:

    "campaign_id": 123428614,
    "impression_id": 1742860,
    "device_id": "1AB422B56B3B49AF8389268A9ACD7246",
    "action": "OPEN_URL",
    "timestamp": "2016-08-22 00:00:01"

Now, your response should be a JSON Object in the following format:

    "success": true,
    "data": {
        "client_id": 4,
        "interaction_id": 33,
        "impression_id": 1429111,
        "pricing_id": 3,
        "created": "2016-08-31T12:28:52+1000",
        "modified": "2016-08-31T12:28:52+1000",
        "id": 15

Other possible responses include:

  • 401 Incorrect Login
  • 404 No Geofences in Range
  • 422 Interaction Input Validation Failed
  • 500 Some Other Error Occurred


You can call the above API to register ad interactions with the following method in the Android SDK:

D2GOSDK.registerInteraction(JSONObject campaign, Context context)

where the campaign is the Interaction JSONObject you pass into the API.