Shop Widget Instructions
The eBay Commerce Network Widget provides publishers with a pre-formatted shopping content module requiring little to no technical expertise. Simply follow the steps below and content will be automatically included in your page.
1. Get started with our simple Widget Set-up Tool.
2. Paste the generated code in your web page(s).
The eBay Commerce Network Widgets are not currently context sensitive (i.e. they don't automatically detect the content of your page), which means you will need to define the search parameters manually. You can either provide a static set of search parameters, or dynamically update these values based on user interactions (e.g. set the widget keyword to a keyword entered into your own sites search box by the user.)
You must provide at least one search parameter, the options being keyword, categoryId, productId, or offerId. A fifth search parameter, 'attributeValue' may be combined with categoryId and/or keyword, but cannot be used on it's own.
Except for categoryId, you can provide multiple values for any of the search parameters in a single request, separated by double pipes ('||'). This allows you to show results for multiple products, offers, or keywords in the same result. You can also provide multiple sets of values for any search parameter, which will cause the widget to rotate through those sets randomly for each new page view.
See below for a few examples of different advanced request configurations.
1. Show results for a single keyword
- sdcrequest.keyword = ["womens jeans"];
2. Show results for a single category and top products in a category
- sdcrequest.categoryId = ["7185"];
- // Top products by category across the network.
- sdcrequest.showTopProducts = "sdc" ;
3. Show results for a single keyword, category, attribute value combination
- sdcrequest.keyword = ["sony"];
- sdcrequest.categoryId = ["7185"];
- sdcrequest.attributeValue = ["ultra_compact"];
4. Show results for a single product
- sdcrequest.productId = ["40940647"];
5. Show results for a single offer
- sdcrequest.offerId = ["q_DA7Cut6RIpD486c4U2OQ=="];
6. Show results for a single keyword and category, with multiple attribute values
- sdcrequest.keyword = ["red"];
- sdcrequest.categoryId = ["31515"];
- sdcrequest.attributeValue = ["ap_gender_age_women||dresses"];
7. Show results for multiple products in the same response
- sdcrequest.productId = ["40940647||40741277"];
8. Show results for multiple offers in the same response
- sdcrequest.offerId = ["q_DA7Cut6RIpD486c4U2OQ==||78MFZvt8rlWDaXIR0doseg=="];
9. Rotate through results for multiple keywords
- sdcrequest.keyword = ["digital cameras", "lcd tvs"];
10. Rotate through results for multiple keyword, category and attributeValue combinations
- // The same set will be selected from keyword, categoryId, and attributeValue
- // when rotating, ensuring parameter combinations make sense. In this example,
- // there are three distinct sets:
- // (keyword="red", categoryId="31515", attributeValue=ap_gender_age_women||dresses)
- // (keyword="", categoryId="96602, attributeValue="brand_nike")
- // (keyword="grey aviator", categoryId="22686", attributeValue="")
- sdcrequest.keyword = ["red", ,"grey aviator"];
- sdcrequest.categoryId = ["31515", "96602","22686"];
- sdcrequest.attributeValue = ["ap_gender_age_women||dresses", "brand_nike"];
11. Rotate through results for multiple sets of products
- sdcrequest.productId = ["40940647||40741277", "28328722||84828538"];
12. Filter by items on sale or items with free shipping
- sdcrequest.showFreeShippingOnly = "1";
- sdcrequest.showOnSaleOnly = "1";
The above examples cover the most common cases. Note that you can pass in any API request to the widget. Reference the API use cases documentaton for more information.
Using the Widget Set-up Tool, you can generate the code for multiple placements to put on the same page. However, you'll need to make some manual changes in order to make it work.
The standard element id is "sdcWidgetContent", so you'll need to change this id to a unique one.
You'll also need to update this function call with that unique id.
Along with the customizable four widget sizes provided in the Widget Set-up Tool, additional non-standard designs are available below:
designId: 'gallery' suggested minimum height: 350 suggested minimum width: 640
designId: 'textlike' suggested minimum height: 520 suggested minimum widght: 700
designId: 'listinglike' suggested minimum height: 560 suggested minimum widght: 550