---
title: endpoint for delivering click events back to the tracking infrastructure via tracking link
slug: fluid-adserver-api/YdZ9-endpoint-for-delivering-click-events-back-to-the-tracking-infrastructure-via-tracking-link
docTags: 
createdAt: 2024-05-16T12:14:49.139Z
---

{
  "id": "DJXrgiCEaIN_I-mAVni7S",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://localhost/click/{trackingData}",
    "servers": [
      {
        "url": "https://localhost/click/{trackingData}"
      }
    ],
    "name": "endpoint for delivering click events back to the tracking infrastructure via tracking link",
    "description": "<p>Click tracking endpoint which should be triggered when a user clicks on an ad. Links to this API are constructed\nby the spa-adserver for each sponsored product in the ad response.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "trackingData",
          "type": "string",
          "description": "<p>Encrypted and encoded tracking data that is constructed by the spa-adserver.</p>"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "The tracking data string is manipulated and isn't the encrypted base64 encoded string coming\nfrom the spa-adserver.\n",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "The tracking data path variable is missing from the URL.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "HfHJ0jPJ-fqpbup57M8j8",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://localhost/click/{trackingData} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "W33jCpfNSP9sV1gOkYwV2",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://localhost/click/{trackingData}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "1qiWoH0lwWqF--ncRWElw",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://localhost/click/{trackingData}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "RS7i4yaAIQtw3CgXGJhu1",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://localhost/click/{trackingData}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "HfHJ0jPJ-fqpbup57M8j8"
    },
    "results": {
      "languages": [
        {
          "id": "sdbNQObHe9egM4TO-Jc0O",
          "language": "200",
          "code": "// OK\n"
        },
        {
          "id": "NIJrUlHY7zx1bgjnUnCmy",
          "language": "400",
          "code": "// The tracking data string is manipulated and isn't the encrypted base64 encoded string coming\nfrom the spa-adserver.\n"
        },
        {
          "id": "cdTHuHJBNqqgwts9OwiFF",
          "language": "404",
          "code": "// The tracking data path variable is missing from the URL.\n"
        }
      ],
      "selectedLanguageId": "sdbNQObHe9egM4TO-Jc0O"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}