NAVNavbar
Logo
php python csharp java

Get Google Shopping Sellers Ad URL

Google Shopping Sellers Ad URL is designed to provide you with a full URL of the advertisement containing all additional parameters set by the seller.

Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-dashboard

<?php
// You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip
require('RestClient.php');
$api_url = 'https://api.dataforseo.com/';
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-dashboard
$client = new RestClient($api_url, null, 'login', 'password');

try {
   // get ad_url by the ad_aclk
   // GET /v3/merchant/google/sellers/ad_url/$ad_aclk
   // use the ad_aclk that you received upon a sellers task
   $ad_aclk = "DChcSEwiSl5TKpbPoAhVFmdUKHfa_B_wYABADGgJ3cw&sig";
   $result = $client->get('/v3/merchant/google/sellers/ad_url/' . $ad_aclk);
   print_r($result);
   // do something with result
} catch (RestClientException $e) {
   echo "\n";
   print "HTTP code: {$e->getHttpCode()}\n";
   print "Error code: {$e->getCode()}\n";
   print "Message: {$e->getMessage()}\n";
   print  $e->getTraceAsString();
   echo "\n";
}
$client = null;
?>

The above command returns JSON structured like this:

{
  "version": "0.1.20200416",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.0884 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "04171245-0696-0187-0000-293efd87a2c3",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0603 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "merchant",
        "google",
        "sellers",
        "ad_url",
        "DChcSEwiSl5TKpbPoAhVFmdUKHfa_B_wYABADGgJ3cw&sig"
      ],
      "data": {
        "se_type": "shops_list",
        "api": "merchant",
        "function": "sellers",
        "se": "google",
        "ad_aclk": "DChcSEwiSl5TKpbPoAhVFmdUKHfa_B_wYABADGgJ3cw&sig"
      },
      "result": [
        {
          "ad_aclk": "DChcSEwiSl5TKpbPoAhVFmdUKHfa_B_wYABADGgJ3cw&sig",
          "ad_url": "http://clickserve.dartsearch.net/link/click?lid=92700050472569954&ds_s_kwgid=58700004954890252&ds_s_inventory_feed_id=97700000001684512&&ds_e_adid=344670430295&ds_e_matchtype=search&ds_e_device=c&ds_e_network=g&ds_e_product_group_id=828856929311&ds_e_product_id=190198456175%20(Installment)&ds_e_product_merchant_id=8393380&ds_e_product_country=US&ds_e_product_language=en&ds_e_product_channel=online&ds_e_product_store_id={product_store_id}&ds_url_v=2&ds_dest_url=https://www.t-mobile.com/cell-phone/apple-iphone-8-plus?sku=190198456175&gclsrc=aw.ds&&cmpid=ADV_PL_P_SHOPIPHN8P_92700050472569954_344670430295"
        }
      ]
    }
  ]

Description of the fields for sending a request:

Field name Type Description
shop_ad_aclk string unique ad click referral parameter
you can obtain this parameter with Google Shopping Sellers

‌‌‌‌
‌‌As a response of the API server, you will receive JSON-encoded data containing a tasks array with the information specific to the set tasks.

Description of the fields in the results array:

Field name Type Description
version string the current version of the API
status_code integer general status code
you can find the full list of the response codes here
status_message string general informational message
you can find the full list of general informational messages here
time string execution time, seconds
cost float total tasks cost, USD
tasks_count integer the number of tasks in the tasks array
tasks_error integer the number of tasks in the tasks array that were returned an error
tasks array array of tasks
        id string task identifier
unique task identifier in our system in the UUID format
        status_code integer status code of the task
generated by DataForSEO; can be within the following range: 10000-60000
you can find the full list of the response codes here
        status_message string informational message of the task
you can find the full list of general informational messages here
        time string execution time, seconds
        cost float cost of the task, USD
        result_count integer number of elements in the result array
        path array URL path of the GET request
        data array contains the same parameters that you specified in the POST request
        result array array of results
            ad_aclk string unique ad click referral parameter
            ad_url string full URL of the advertisement

‌‌