Created : Feb, 04, 2016 | Last Updated: April, 15, 2016
SpikeCom offers multiple ad and placement types to serve.
Three commonly used integration options are available to you, which can support minor variations to suit your individual needs.
JS & IFrame types can be used directly, simply copy the placement tag and paste it in your application where you want ad to be served.
For JSON, simply copy the placement tag, modify the url and replace "(enter your api access key here)" with the access key which can be fetched from 'Settings', you can add multiple filter options here to get the ads in response accordingly. For the list of available filter options, please refer to "Serve" API details below in order to check how the system decides on which ads to serve refer to section "Ads Serving & Refresh Logic". Once you are done with the JSON AD API Request URL modification, place it on your page load and from the ads responded you can display them on your page as you want.
In case of JSON , whenever the JSON AD API Request URL is called we register an impression for all responded ads, but for subsequent impressions without refresh/page-load i.e for example upon scrolling, publisher shall use our 'viewable_url' callback api where as 'eligible_url' callback api is only at pageload to register impressions accordingly, similarly for registering clicks, publisher shall use our 'redirect_url' to register clicks. Value of these fields can be found against each ad in our JSON AD API Response.
Following Api's are supported/involved in Spike Com Ad-Serving,
This is taken from 'Get Placement Tag' link of Placements grid and the snippet can then be used to serve ads.
It has following properties,
Name | Type | Description |
placementID | string | Id of placement for which ad needs to be served. |
type | string | possible values are js/json/iframe |
platform | string | possible values are ios/android/other |
userId | string | Id of user ad is serving to (optional) |
userSessionId | string | Session Id of user ad is serving to (optional) |
extraData | string | Ads with keywords containing this supplied value will be served |
lang | string | to filter ad creatives based on supplied language, for possible values see below |
dk | string | datakeys supplied as json parameter to further serve ads after filtration for further description see below |
ageGroup | string | possible values are 1/2/3/4 where 1 means Between 18-30 , 2 means Between 30-46 , 3 means Between 46-60 and 4 means Above 60 |
gender | string | possible values are Male/Female/Other |
longitutde | double | this will further filter ads based on ad's location with radius |
lattitude | double | this will further filter ads based on ad's location with radius |
groupPlacements | bool | this will allow to fetch ads from all placements belonging to same placement group as of this current placement |
count | int | applicable for json type only, if not supplied default value is 1 , if supplied 0 then all ads after filter logic will be served , if supplied with some other value then that many ads will be served |
slotNo | int | applicable for carousal type placement only, if not supplied by default will return 1 running ad from any slot , if supplied then will return running ad from that slot it can be combined with count to serve many ads for each slot |
product_branch_id | string | if supplied then the responded ads will only be responded with products of this branch id if any of such products were selected in the ads. |
https://api-sandbox.spikecom.net/api/adserve/serve/?placementID=YOUR_SELECTED_PLACEMENT_ID&type=json&key=YOUR_API_KEY
*- placementID & type are mandatory to supply where as other properties are optional for further filtration.
*- placementID can be found for any placement by viewing it and picking the last portion from the url as highlighted below.
https://api-sandbox.spikecom.net/Placement/View/YOUR_SELECTED_PLACEMENT_ID
*- In case if type = json is used the response will be as below, the values will vary based on the serving ad.
{
"status":"success",
"lang":"Default",
"adItems":[
{
"ad_Id":"YOUR_AD_ID",
"placement_Id":"YOUR_SELECTED_PLACEMENT_ID",
"placementGroup_Id":"YOUR_SELECTED_PLACEMENT_GROUP_ID",
"serving_priority":1,
"ad_metaData":[
],
"width":300,
"height":250,
"responsive":false,
"ad_title":"Placement 3 Ad # 2",
"alt_text":"",
"target":"_blank",
"tracking_pixel_url":"",
"body":"",
"redirect_url":"https://api-sandbox.spikecom.net/api/adserve/clickregister/?placementID=YOUR_SELECTED_PLACEMENT_ID&adID=YOUR_AD_ID",
"destination_url":"",
"refresh_url":"https://api-sandbox.spikecom.net/api/adserve/refresh/?placementID=YOUR_SELECTED_PLACEMENT_ID&type=json",
"refresh_time_ms":0,
"image_url":"https://ads-spike-nonprod.azureedge.net/media/YOUR_MEDIA_FILENAME_AND_EXTENSION",
"lang":"Arabic",
"per_user_limit":null,
"daily_limit":null,
"viewable_url":"https://api-sandbox.spikecom.net/api/adserve/viewableimpression/?placementID=YOUR_SELECTED_PLACEMENT_ID&adID=YOUR_AD_ID",
"eligible_url":"https://api-sandbox.spikecom.net/api/adserve/eligibleimpression/?placementID=YOUR_SELECTED_PLACEMENT_ID&adID=YOUR_AD_ID",
"unique_delivery":false,
"adStartDate":"02/16/2022",
"adEndDate":"02/20/2022",
"adTargetAgeGroup":"",
"adTargetGender":null,
"adTargetGeoLocation":"40.7324319 -73.82480777777776",
"adTargetGeoRadius":500,
"campaignStartDate":"02/16/2022",
"campaignEndDate":"02/20/2022"
}
]
}
Name | Description |
status | It shows the status of response. |
placementId | Id of placement for which ad is being served. |
lang | Language of creatives as per the request. |
adItems | It contains ad item object inside it. |
ad_Id | Id of ad being served. |
serving_priority | priority of ad being served. (1-High , 2-Medium and 3-Low) |
ad_metaData | Array containing meta data key value pairs for this ad. |
width | width of the placement for which ad is being served. |
height | height of the placement for which ad is being served. |
responsive | responsive setting for this placement. |
ad_title | title of ad being served. |
alt_text | alternate text to display for image type ad. |
target | specifying new or same window will open the destination link of this ad. |
redirect_url | url for registering a click. |
destination_url | destination url of image type ad. |
refresh_url | refresh url for ad being served , it's used if auto-refresh is set to non-zero value in milliseconds. |
image_url | url of image creative being served. |
lang | language of this particular creative from ad being served if specified else Default |
per_user_limit | per user limit set against ad being served. |
daily_limit | daily limit set against ad being served. |
aquisition_url | url to register aquisition for this placement and ad. |
addToCart_url | url to register add to cart transaction for this placement and ad. |
viewable_url | url to register viewable impression for this placement and ad. |
eligible_url | url of register eligible impression for this placement and ad. |
unique_delivery | unique delivery configuration value set against ad being served. |
adStartDate | start date of ad. |
adEndDate | end date of ad. |
adTargetAgeGroup | target age group for ad being served 1=Between 18-30, 2=Between 30-46 , 3=Between 46-60 and 4=Above 60. |
adTargetGender | target gender for ad being served. |
adTargetGeoLocation | target location's longitude and latitude set for ad being served. |
adTargetGeoRadius | target location's radius set for ad being served. |
campaignStartDate | start date of campaign of ad being served. |
campaignEndDate | end date of campaign of ad being served. |
This is an optional field , possible values is one from below, based on the supplied value the ad's having creative with this language will be served only.
Data-keys can be created against publishers from Targets window and Rules can be set on those keys from Data-Key-Segments window.
These data-keys can be supplied to further filter ads and serve only those ad's which have any Target Segment fulfilling the specified rule.
https://api-sandbox.spikecom.net/api/adserve/serve/?placementID=YOUR_SELECTED_PLACEMENT_ID&type=js&dk={"age":20,"gender":"female"}&ageGroup=1&gender=male
Notice how age and gender data-keys were supplied, even when we already have predefined set of filters for that like ageGroup and gender which is defined at ad level directly, so it's actually pointless to define such data-keys , instead some other data keys can be defined and used. Note that the data-key filters are different and if specified will only be searched in ad's target segments fulfilling the specified rule while calling it and data-key property values will not be compared with any existing field of ad.
This end point is used to register a viewable impression whenever the ad comes in view-port completely.
It has following properties,
Name | Type | Description |
placementID | string | Id of placement for which ad was served and viewed. |
adID | string | Id of ad which ad was served and viewed. |
https://api-sandbox.spikecom.net/api/adserve/viewableimpression/?placementID=YOUR_SELECTED_PLACEMENT_ID&adID=YOUR_AD_ID
Response will have a json indicating response code for success or failures with error or success message.
{
succeeded: true,
code: 200,
result: "Impression successfully registered.",
exceptionType: "",
errors: [ ]
}
This end point is used to register an eligible impression whenever the ad is served.
It has following properties,
Name | Type | Description |
placementID | string | Id of placement for which ad was served |
adID | string | Id of ad which ad was served |
userId | string | Id of user session responsible for this transaction (optional) |
userSessionId | string | Id of user session responsible for this transaction (optional) |
platform | string | platform of transaction, possible values are ios/android/other (optional, by default other will be used) |
https://api-sandbox.spikecom.net/api/adserve/eligibleimpression/?placementID=YOUR_SELECTED_PLACEMENT_ID&adID=YOUR_AD_ID
Response will have a json indicating response code for success or failures with error or success message.
{
succeeded: true,
code: 200,
result: "Impression successfully registered.",
exceptionType: "",
errors: [ ]
}
This end point is used to register a click whenever the ad is clicked on.
It has following properties,
Name | Type | Description |
placementID | string | Id of placement for which ad was served and clicked |
adID | string | Id of ad which ad was served and clicked |
userId | string | Id of user session responsible for this transaction (optional) |
userSessionId | string | Id of user session responsible for this transaction (optional) |
platform | string | platform of transaction, possible values are ios/android/other (optional, by default other will be used) |
https://api-sandbox.spikecom.net/api/adserve/clickregister/?placementID=YOUR_SELECTED_PLACEMENT_ID&adID=YOUR_AD_ID
Response will have a json indicating response code for success or failures with error or success message.
{
succeeded: true,
code: 200,
result: "Click successfully registered.",
exceptionType: "",
errors: [ ]
}
This end point is used to register a conversion/aquisition.
It has following properties,
Name | Type | Description |
placementID | string | Id of placement for which ad was served and clicked |
adID | string | Id of ad which ad was served and clicked |
userId | string | Id of user session responsible for this transaction (optional) |
userSessionId | string | Id of user session responsible for this transaction (optional) |
platform | string | platform of transaction, possible values are ios/android/other (optional, by default other will be used) |
https://api-sandbox.spikecom.net/api/adserve/aquisition/?placementID=YOUR_SELECTED_PLACEMENT_ID&adID=YOUR_AD_ID
Response will have a json indicating response code for success or failures with error or success message.
{
succeeded: true,
code: 200,
result: "Aquisition successfully registered.",
exceptionType: "",
errors: [ ]
}
This end point is used to register an 'add-to-cart' type of transaction.
It has following properties,
Name | Type | Description |
placementID | string | Id of placement for which ad was served and clicked |
adID | string | Id of ad which ad was served and clicked |
userId | string | Id of user session responsible for this transaction (optional) |
userSessionId | string | Id of user session responsible for this transaction (optional) |
platform | string | platform of transaction, possible values are ios/android/other (optional, by default other will be used) |
https://api-sandbox.spikecom.net/api/adserve/addToCart/?placementID=YOUR_SELECTED_PLACEMENT_ID&adID=YOUR_AD_ID
Response will have a json indicating response code for success or failures with error or success message.
{
succeeded: true,
code: 200,
result: "Aquisition successfully registered.",
exceptionType: "",
errors: [ ]
}
Apart from above API's there are some other API's as well that we support can help in integration which are as follows,
This end point is used to respond with all the placements of a publisher.
It has following properties,
Name | Type | Description |
publisherId | string | Id of publisher. |
key | string | API Access Key of that publisher. |
https://api-sandbox.spikecom.net/api/adserve/getplacement/?publisherId=YOUR_PUBLISHER_ID&key=YOUR_API_KEY
Response will have a Json for all placements of that publisher.
[
{
"noOfCampaigns":3,
"placementId":"YOUR_PLACEMENT_ID",
"placementTitle":"Placement Title",
"placementType":"Standard",
"objectType":"banner",
"publisherId":"YOUR_PUBLISHER_ID",
"publisherName":"Publisher Name",
"placementSize":"300x250",
"placementSizeHeight":250,
"placementSizeWidth":300,
"responsiveEnabled":true,
"placementGroupId":"YOUR_PLACEMENT_GROUP_ID",
"placementGroupName":"Banner",
"cpdRate":0.0,
"cpmRate":1.0,
"metaData":[
{
"key":"mobile_placements",
"value":"home_banner",
"language":null
},{
"key":"mobile_screens",
"value":"home",
"language":null
}
],
"multipleAdvertisersAllowed":true,
"positionPriority":1,
"isCampaignSpace":true,
"status":"Active",
"createdOn":"2022-04-05T06:25:51.218Z"
},{
"noOfCampaigns":1,
"placementId":"YOUR_PLACEMENT_ID",
"placementTitle":"Placement Title",
"placementType":"Standard",
"objectType":"strip",
"publisherId":"YOUR_PUBLISHER_ID",
"publisherName":"Publisher Name",
"placementSize":"180x150",
"placementSizeHeight":150,
"placementSizeWidth":180,
"responsiveEnabled":true,
"placementGroupId":"YOUR_PLACEMENT_GROUP_ID",
"placementGroupName":"Strip Banner",
"cpdRate":0.0,
"cpmRate":0.0,
"metaData":[
{
"key":"mobile_placements",
"value":"home_strip_banner",
"language":null
},{
"key":"mobile_screens",
"value":"home",
"language":null
},{
"key":"position",
"value":"1",
"language":null
}
],
"multipleAdvertisersAllowed":true,
"positionPriority":2,
"isCampaignSpace":true,
"status":"Active",
"createdOn":"2022-04-05T06:27:12.459Z"
}
]
This end point is used to respond with all the brands of a publisher.
It has following properties,
Name | Type | Description |
publisherId | string | Id of publisher. |
placementId | string | Id of placement. |
key | string | API Access Key of that publisher. |
https://api-sandbox.spikecom.net/api/adserve/brands/?publisherId=YOUR_PUBLISHER_ID&key=YOUR_API_KEY
Note: publisherId or placementId either one of them can be supplied in order to get all brands of a publisher.
Response will have a Json for all brands of that publisher.
[
{
"key":"BRAND_UNIQUE_KEY",
"brand":"Oppo",
"category":"Mobiles Phones",
"description":"Mobile, Tablets and Other Brand",
"keywords":["Mobiles Phones","Oppo","Android Mobiles"],
"language":"English",
"location":"All over the world",
"longitude":40.0,
"lattitude":30.0
},{
"key":"BRAND_UNIQUE_KEY",
"brand":"J.",
"category":"Perfumes",
"description":"Clothing Brand",
"keywords":["Perfumes","J.Brand","J."],
"language":"Urdu",
"location":"Karachi, Lahore, Islamabad",
"longitude":50.0,
"lattitude":60.0
},{
"key":"BRAND_UNIQUE_KEY",
"brand":"Oppo",
"category":"Mobiles Phones",
"description":"Mobile, Tablets and Other Brand",
"keywords":["Mobiles Phones","Oppo","Android Mobiles"],
"language":"English",
"location":"All over the world",
"longitude":40.0,
"lattitude":30.0
}
]
This end point is used to upload new or update existing products of a publisher.
Type : POST
It has no parameters,however In the body add a gzip compressed file in which should be a json originally in the following format , where specify api access key of your publisher account against "ApiKey" and add all the products against "Products" field array , sample share below,,
{
"ApiKey": "YOUR_API_ACCESS_KEY",
"Products": [
{
"Sno": "YOUR_PRODUCT_UNIQUE_IDENTIFIER",
"Language": "YOUR_PRODUCT_PRIMARY_LANGUAGE",
"Barcode": "YOUR_PRODUCT_BARCODE",
"SKU": "YOUR_PRODUCT_SKU",
"ProductName": "YOUR_PRODUCT_NAME_IN_PRIMARY_LANGUAGE",
"Category": "YOUR_PRODUCT_CATEGORY_IN_PRIMARY_LANGUAGE",
"Brand": "YOUR_PRODUCT_BRAND_IN_PRIMARY_LANGUAGE",
"Branch": "YOUR_PRODUCT_BRANCH_IN_PRIMARY_LANGUAGE",
"Keywords": "YOUR_PRODUCT_GENERIC_KEYWORDS_IN_PRIMARY_LANGUAGE",
"ImageUrl": "YOUR_PRODUCT_IMAGE_URL",
"Price": "YOUR_PRODUCT_PRICE",
"IsEnabled": "TRUE OR FALSE",
"InStock": "TRUE OR FALSE",
"DiscountedPrice": "YOUR_PRODUCT_DISCOUNTED_PRICE",
"ProductId": "YOUR_PRODUCT_ID",
"BranchId": "YOUR_PRODUCT_BRANCH_ID",
"BrandId": "YOUR_PRODUCT_BRAND_ID",
"CategoryId": "YOUR_PRODUCT_CATEGORY_ID",
"LanguageOverrides": [
{
"Language" : "YOUR_PRODUCT_SECOND_LANGUAGE",
"ProductName" : "YOUR_PRODUCT_NAME_IN_SECOND_LANGUAGE",
"Branch": "YOUR_PRODUCT_BRANCH_NAME_IN_SECOND_LANGUAGE",
"Brand" : "YOUR_PRODUCT_BRAND_NAME_IN_SECOND_LANGUAGE",
"Category" : "YOUR_PRODUCT_CATEGORY_NAME_IN_SECOND_LANGUAGE",
"Keywords" : "YOUR_PRODUCT_GENERIC_KEYWORDS_IN_SECOND_LANGUAGE",
"ImageUrl" : "YOUR_PRODUCT_IMAGE_URL_IN_SECOND_LANGUAGE",
},
{
"Language" : "YOUR_PRODUCT_THIRD_LANGUAGE",
"ProductName" : "YOUR_PRODUCT_NAME_IN_THIRD_LANGUAGE",
"Branch": "YOUR_PRODUCT_BRANCH_NAME_IN_THIRD_LANGUAGE",
"Brand" : "YOUR_PRODUCT_BRAND_NAME_IN_THIRD_LANGUAGE",
"Category" : "YOUR_PRODUCT_CATEGORY_NAME_IN_THIRD_LANGUAGE",
"Keywords" : "YOUR_PRODUCT_GENERIC_KEYWORDS_IN_THIRD_LANGUAGE",
"ImageUrl" : "YOUR_PRODUCT_IMAGE_URL_IN_THIRD_LANGUAGE",
}
]
},
{
"Sno": "YOUR_PRODUCT_UNIQUE_IDENTIFIER",
"Language": "YOUR_PRODUCT_PRIMARY_LANGUAGE",
"Barcode": "YOUR_PRODUCT_BARCODE",
"SKU": "YOUR_PRODUCT_SKU",
"ProductName": "YOUR_PRODUCT_NAME_IN_PRIMARY_LANGUAGE",
"Category": "YOUR_PRODUCT_CATEGORY_IN_PRIMARY_LANGUAGE",
"Brand": "YOUR_PRODUCT_BRAND_IN_PRIMARY_LANGUAGE",
"Branch": "YOUR_PRODUCT_BRANCH_IN_PRIMARY_LANGUAGE",
"Keywords": "YOUR_PRODUCT_GENERIC_KEYWORDS_IN_PRIMARY_LANGUAGE",
"ImageUrl": "YOUR_PRODUCT_IMAGE_URL",
"Price": "YOUR_PRODUCT_PRICE",
"IsEnabled": "TRUE OR FALSE",
"InStock": "TRUE OR FALSE",
"DiscountedPrice": "YOUR_PRODUCT_DISCOUNTED_PRICE",
"ProductId": "YOUR_PRODUCT_ID",
"BranchId": "YOUR_PRODUCT_BRANCH_ID",
"BrandId": "YOUR_PRODUCT_BRAND_ID",
"CategoryId": "YOUR_PRODUCT_CATEGORY_ID",
"LanguageOverrides": [
{
"Language" : "YOUR_PRODUCT_SECOND_LANGUAGE",
"ProductName" : "YOUR_PRODUCT_NAME_IN_SECOND_LANGUAGE",
"Branch": "YOUR_PRODUCT_BRANCH_NAME_IN_SECOND_LANGUAGE",
"Brand" : "YOUR_PRODUCT_BRAND_NAME_IN_SECOND_LANGUAGE",
"Category" : "YOUR_PRODUCT_CATEGORY_NAME_IN_SECOND_LANGUAGE",
"Keywords" : "YOUR_PRODUCT_GENERIC_KEYWORDS_IN_SECOND_LANGUAGE",
"ImageUrl" : "YOUR_PRODUCT_IMAGE_URL_IN_SECOND_LANGUAGE",
},
{
"Language" : "YOUR_PRODUCT_THIRD_LANGUAGE",
"ProductName" : "YOUR_PRODUCT_NAME_IN_THIRD_LANGUAGE",
"Branch": "YOUR_PRODUCT_BRANCH_NAME_IN_THIRD_LANGUAGE",
"Brand" : "YOUR_PRODUCT_BRAND_NAME_IN_THIRD_LANGUAGE",
"Category" : "YOUR_PRODUCT_CATEGORY_NAME_IN_THIRD_LANGUAGE",
"Keywords" : "YOUR_PRODUCT_GENERIC_KEYWORDS_IN_THIRD_LANGUAGE",
"ImageUrl" : "YOUR_PRODUCT_IMAGE_URL_IN_THIRD_LANGUAGE",
}
]
}
]
}
https://api-sandbox.spikecom.net/api/product/upload (data-size limit = 50K)
https://api-sandbox.spikecom.net/api/product/bulkupload (data-size limit = no limit , happens in backend queue jobs)
Note: Product streamline api usage rate limit is 5 times per day.
Based on unique combination of SKU , Language ,Price and BranchId the system will check for new and existing products , for all the new ones it will add them and for all the existing ones it will update them.
This end point is used to delete existing products of a publisher either by productId or by branchId.
Type : DELETE
sample body shared below,
{
"ApiKey": "YOUR_API_ACCESS_KEY",
"Products":[
{
"ProductId": "YOUR_PRODUCT_ID",
"BranchId": "YOUR_PRODUCT_BRANCH_ID"
},
{ "ProductId": "YOUR_PRODUCT_ID",
"BranchId": "YOUR_PRODUCT_BRANCH_ID"
} ]
}
When in products array a record with both productId and branchId is given it will delete that product for that branch only , When a record with only ProductId is given then it will delete that product only and for all branches and When a record with only BranchId given then it will delete all products from that branch.
http://api-sandbox.spikecom.net/api/product/delete
Based on the provided productId or branchId or combination of these system will delete those products.
When placement tag is used in the form of JS and IFrame , simply copying and pasting that tag in your placement of choice on supported platforms will result in serving of running ads on that placement.
In JS & IFrame eligible impression , viewable impression , clicks are all registered automatically and is handled by our server which is also responsible to serve ads as well as to track and record these transactions on the served ads, where as in order to track and record 'aquisition' or 'addToCart' type of transaction publisher must fetch data-attributes from the js & iframe response in which we create a parent 'div' element where the tag is used and serve our ad inside it.
This div have some data-attributes that we use and some that publisher can use like in order to track and record 'aquisition' and 'addToCart' type of transaction publisher must fetch and read 'data-aquisition-callback' and 'data-addToCart-callback' urls and make a call on these to make us register that kind of transaction. All other data-attributes are being used by our ad-serving platform itself to register and track other kinds of transactions.
<script type='text/javascript'>document.write('<script src="https://api-sandbox.spikecom.net/api/adserve/serve/?placementID=YOUR_PLACEMENT_ID&type=js&platform=YOUR_PLATFORM" type="text/javascript"></script>');</script>
<script type='text/javascript'>document.write('<script src="https://api-sandbox.spikecom.net/api/adserve/serve/?placementID=YOUR_PLACEMENT_ID&type=iframe&platform=YOUR_PLATFORM" type="text/javascript"></script>');</script>
Response will contain JS/IFrame serving running ads from our server.
Apart from above common integration options there are some sprcific to certain placement object types, understanding their configuration setup and integration can help in integrating those placements as well, which are as follows,
Carousal is a special type of placement allowing user to create a placement of type carousal and define its slots/slides and then it can be used to serve different ads of various advertisers on different slots simultaneously if that slot is available for that day.
In this special type we allow selection of slot while creating an Ad-Item and 'slotNo' input paramater can be supplied in the ad-serving request call which will serve running ads on that slot.
For Js & IFrame , simply copy our placement tag after selecting the slotNo and then paste it inside the item div of each slide on your carousal type control. Just make sure the item div representing each slide on your carousal must have some 'id' defined on them and must be using class 'spikeCarousalAdSlot' in order for us to auto track clicks & impressions.
For Json , you can specify slotNo input as part of your ad-serving request call to our server , in response of which our server will serve you with running ads on that slot only. In case you want all running ads to be served irrespective of which slot they belong to then simply make a request call without slotNo input but with count value greater then or equal to total running ads on this placement so the server will serve you with all the running ads on this placement.
<script type='text/javascript'>document.write('<script src="https://api-sandbox.spikecom.net/api/adserve/serve/?placementID=YOUR_PLACEMENT_ID&type=YOUR_RESPONSE_TYPE&platform=YOUR_PLATFORM&slotNo=YOUR_SLOT_NO" type="text/javascript"> </script >');</script>
This kind of placement is allowed for multiple advertisers to book on same date, the way it works in the system is you need to create separate TopListing type placements for each slot in top listings in a single group like Placement 1: Top Listing Slot 1 (TopListing) Placement 2: Top Listing Slot 2 (TopListing) Placement 3: Top Listing Slot 3 (TopListing) for this simply go to 'Placements' module and create a new placement inside it in the Placement Page dropdown there's an option to create your own group click on it and name this group as your TopListing Group then specify all other values of your slot 1 on this top listing placement and save , in similar fashion create as many placements as you have slots in your top listing , make sure to select the same 'TopListing' group you created while creating first slot placement for the rest of slots as well and not create more groups..
For this to work , publisher must first define their supported Brands in Brand configuration.
Each advertiser when creating ads on these will only be able to select their own allowed brand. Once all brand ads are created and reviewed and approved in the ad-request api use 'groupPlacements=true' params to serve ads from all 3 slot placements in a single response. This can even further be customized if you want different top listings for different regions then you can create your custom key of regionId and create its different segment rules specifying to its different possible values and then in ad-creation these segments can be selected and in ad-request url append 'dk={"regionId":"1"}' to get all slot brands for region 1 only and 'dk={"regionId":"2"}' to get all slot brands for region 2..
Target Data keys and Target Data Segments are the section where you can create your custom targetting keys and rules. A group of rules in Spikecom system is called a segment. This will be useful if you wish to serve your ads differently based on regions or areas or cities or by any custom criteria. Simply go to Target Data Keys first and create your criteria key there like for example 'regionId' type string..
After defining the key you need to setup the rules on this key by which you will target different ads. For this go to Target Data Segments and create a new segment select your key and operator and value for example regionId is the key , '=' is the operator and '1' is the value. define all possible rules for this key i.e in our example for all regions.
Now simply go to Placements module and from the list click on 'Get Placement Tag' for any top listing slot placement and copy the generated tag. In the default generated tag replace '(enter your api access key here)' with your API access key which you can get from 'Settings' module also append '&groupPlacements=true' in order to get running ads in response from all slot placements inside this single 'TopListing' group that we created in step 1 while creating placements.
In order to recieve region wise ads differently you need to append your datakey params in the request as well like '&dk={regionId:1}' to serve ads that were marked with this rule segment. This way you can achieve different brand ads to be served at different slots for different regions.
<script type='text/javascript'>document.write('<script src="https://api-sandbox.spikecom.net/api/adserve/serve/?placementID=YOUR_PLACEMENT_ID&type=YOUR_RESPONSE_TYPE&platform=YOUR_PLATFORM&groupPlacements=true" type="text/javascript"> </script >');</script>
Any type of ad that allows products or brands selection will automatically contain the selected whole products in the ad response's meta data where the type is 'product'..
Also any custom meta key defined in the publisher configuration will allow us to define their prefix or default values at placement level , these meta keys and their default values will also be part of ad response's meta data where the type is 'userdefined' and the key will be what was set in publisher configuration..
For details please see "ad_metaData" in below sample response of an ad having products as well as custom meta keys defined for deeplinks as part of ad's meta data in response.
The selected products list is part of metavalue for 'product' type of meta data which is by-default in raw string format and has to be parsed into JSON first to process..
The combination of product type of meta data giving us all the selected product details and of all the default values of all custom meta keys can be used to generate custom deeplinks.
https://api-sandbox.spikecom.net/api/adserve/serve/?placementID=YOUR_PLACEMENT_ID&type=json&kw=YOUR_SEARCH_KEYWORD&key=YOUR_API_KEY
{
"status": "success",
"lang": "Default",
"adItems": [{
"ad_Id": "YOUR_AD_ID",
"placement_Id": "YOUR_PLACEMENT_ID",
"placementGroup_Id": "YOUR_PLACEMENT_GROUP_ID",
"serving_priority": 1,
"ad_metaData": [{
"MetaKey": "YOUR_METADATA_ID",
"MetaValue": "{\"catalogId\":null,\"id\":\"YOUR_METADATA_ID\",\"skuId\":\"YOUR_SKU_ID\",\"barcode\":\"YOUR_BARCODE_ID\",\"name\":\"YOUR_PRODUCT_NAME\",\"brand\":\"YOUR_BRAND_NAME\",\"category\":\"YOUR_PRODUCT_CATEGORY\",\"language\":\"YOUR_KEYWORDS_LANGUAGE\",\"keywords\":[\"YOUR_KEYWORDS\"],\"imageUrl\":\"YOUR_SKU_IMAGE_URL",\"IsFeatured\":\"true"}",
"Language": "YOUR_METADATA_LANGUAGE",
"Type": "product"
},
{
"MetaKey": "YOUR_METADATA_ID",
"MetaValue": "{\"catalogId\":null,\"id\":\"YOUR_METADATA_ID\",\"skuId\":\"YOUR_SKU_ID\",\"barcode\":\"YOUR_BARCODE_ID\",\"name\":\"YOUR_PRODUCT_NAME\",\"brand\":\"YOUR_BRAND_NAME\",\"category\":\"YOUR_PRODUCT_CATEGORY\",\"language\":\"YOUR_KEYWORDS_LANGUAGE\",\"keywords\":[\"YOUR_KEYWORDS\"],\"imageUrl\":\"YOUR_SKU_IMAGE_URL",\"IsFeatured\":\"true"}",
"Language": "YOUR_METADATA_LANGUAGE",
"Type": "product"
},
{
"MetaKey": "YOUR_METADATA_ID",
"MetaValue": "{\"catalogId\":null,\"id\":\"YOUR_METADATA_ID\",\"skuId\":\"YOUR_SKU_ID\",\"barcode\":\"YOUR_BARCODE_ID\",\"name\":\"YOUR_PRODUCT_NAME\",\"brand\":\"YOUR_BRAND_NAME\",\"category\":\"YOUR_PRODUCT_CATEGORY\",\"language\":\"YOUR_KEYWORDS_LANGUAGE\",\"keywords\":[\"YOUR_KEYWORDS\"],\"imageUrl\":\"YOUR_SKU_IMAGE_URL",\"IsFeatured\":\"false"}",
"Language": "YOUR_METADATA_LANGUAGE",
"Type": "product"
}
],
"width": 300,
"height": 250,
"responsive": false,
"ad_title": "Ad # 1",
"alt_text": null,
"target": null,
"tracking_pixel_url": null,
"body": "",
"redirect_url": "https://api-sandbox.spikecom.net/api/adserve/clickregister/?placementID=YOUR_PLACEMENT_ID",
"destination_url": "",
"refresh_url": "https://api-sandbox.spikecom.net/api/adserve/refresh/?placementID=YOUR_PLACEMENT_ID&type=json",
"refresh_time_ms": 0,
"image_url": "",
"lang": "",
"per_user_limit": null,
"daily_limit": null,
"viewable_url": "https://api-sandbox.spikecom.net/api/adserve/viewableimpression/?placementID=YOUR_PLACEMENT_ID&adID=YOUR_AD_ID",
"eligible_url": "https://api-sandbox.spikecom.net/api/adserve/eligibleimpression/?placementID=YOUR_PLACEMENT_ID&adID=YOUR_AD_ID",
"unique_delivery": false,
"adStartDate": "02/22/2022",
"adEndDate": "02/24/2022",
"adTargetAgeGroup": "",
"adTargetGender": null,
"adTargetGeoLocation": "40.7324319 -73.82480777777776",
"adTargetGeoRadius": 500,
"campaignStartDate": "02/22/2022",
"campaignEndDate": "02/24/2022"
}
]
}
To allow search type placements to be created having similar functionality as of product type inside placement and campaign modules, where as allow keywords & count based ad-serving from JSON AD API.
https://api-sandbox.spikecom.net/api/adserve/serve/?placementID=YOUR_PLACEMENT_ID&type=json&kw=YOUR_SEARCH_KEYWORD&key=YOUR_API_KEY
This will apply an additional filter of keywords on ads with the filters defined in filtration logic, i.e if placement type = product or search and kw parameter value is supplied, system will check for Ads having selected SKU's which have this value in their generic keywords or specific keywords and will respond with those Ads. Incase if the user entered keyword matches with generic keyword of one product and with specific keyword of another product then both products will be part of response, however the one matching with generic keyword will be responded back with "IsFeatured=false" where as the one matching with specific keyword will be responded back with "IsFeatured=true"
You can combine 'count' parameter with 'kw' to get as many ads in response as you want if it remains after filters are applied, where count if not given has a default value of 1 so 1 Ad will be served against single request , similarly count = 0 means all Ads will be served which remains after filters are applied.
{
"status": "success",
"lang": "Default",
"adItems": [{
"ad_Id": "YOUR_AD_ID",
"placement_Id": "YOUR_PLACEMENT_ID",
"placementGroup_Id": "YOUR_PLACEMENT_GROUP_ID",
"serving_priority": 1,
"ad_metaData": [{
"MetaKey": "YOUR_METADATA_ID",
"MetaValue": "{\"catalogId\":null,\"id\":\"YOUR_METADATA_ID\",\"skuId\":\"YOUR_SKU_ID\",\"barcode\":\"YOUR_BARCODE_ID\",\"name\":\"YOUR_PRODUCT_NAME\",\"brand\":\"YOUR_BRAND_NAME\",\"category\":\"YOUR_PRODUCT_CATEGORY\",\"language\":\"YOUR_KEYWORDS_LANGUAGE\",\"keywords\":[\"YOUR_KEYWORDS\"],\"imageUrl\":\"YOUR_SKU_IMAGE_URL",\"IsFeatured\":\"true"}",
"Language": "YOUR_METADATA_LANGUAGE",
"Type": "product"
},
{
"MetaKey": "YOUR_METADATA_ID",
"MetaValue": "{\"catalogId\":null,\"id\":\"YOUR_METADATA_ID\",\"skuId\":\"YOUR_SKU_ID\",\"barcode\":\"YOUR_BARCODE_ID\",\"name\":\"YOUR_PRODUCT_NAME\",\"brand\":\"YOUR_BRAND_NAME\",\"category\":\"YOUR_PRODUCT_CATEGORY\",\"language\":\"YOUR_KEYWORDS_LANGUAGE\",\"keywords\":[\"YOUR_KEYWORDS\"],\"imageUrl\":\"YOUR_SKU_IMAGE_URL",\"IsFeatured\":\"true"}",
"Language": "YOUR_METADATA_LANGUAGE",
"Type": "product"
},
{
"MetaKey": "YOUR_METADATA_ID",
"MetaValue": "{\"catalogId\":null,\"id\":\"YOUR_METADATA_ID\",\"skuId\":\"YOUR_SKU_ID\",\"barcode\":\"YOUR_BARCODE_ID\",\"name\":\"YOUR_PRODUCT_NAME\",\"brand\":\"YOUR_BRAND_NAME\",\"category\":\"YOUR_PRODUCT_CATEGORY\",\"language\":\"YOUR_KEYWORDS_LANGUAGE\",\"keywords\":[\"YOUR_KEYWORDS\"],\"imageUrl\":\"YOUR_SKU_IMAGE_URL",\"IsFeatured\":\"false"}",
"Language": "YOUR_METADATA_LANGUAGE",
"Type": "product"
}
],
"width": 300,
"height": 250,
"responsive": false,
"ad_title": "Ad # 1",
"alt_text": null,
"target": null,
"tracking_pixel_url": null,
"body": "",
"redirect_url": "https://api-sandbox.spikecom.net/api/adserve/clickregister/?placementID=YOUR_PLACEMENT_ID",
"destination_url": "",
"refresh_url": "https://api-sandbox.spikecom.net/api/adserve/refresh/?placementID=YOUR_PLACEMENT_ID&type=json",
"refresh_time_ms": 0,
"image_url": "",
"lang": "",
"per_user_limit": null,
"daily_limit": null,
"viewable_url": "https://api-sandbox.spikecom.net/api/adserve/viewableimpression/?placementID=YOUR_PLACEMENT_ID&adID=YOUR_AD_ID",
"eligible_url": "https://api-sandbox.spikecom.net/api/adserve/eligibleimpression/?placementID=YOUR_PLACEMENT_ID&adID=YOUR_AD_ID",
"unique_delivery": false,
"adStartDate": "02/22/2022",
"adEndDate": "02/24/2022",
"adTargetAgeGroup": "",
"adTargetGender": null,
"adTargetGeoLocation": "40.7324319 -73.82480777777776",
"adTargetGeoRadius": 500,
"campaignStartDate": "02/22/2022",
"campaignEndDate": "02/24/2022"
}
]
}
When the placement tag is used, it sends a request to our server for serving an Ad against this placement, Ads are served from our server based on this logic. The Server then