How to use dynamic categories in your eBay listing

To embed dynamic eBay store categories in your listing template, you can use the example code snippet below and tweak it according to your needs.

Add a <div id="categories_wrapper">Categories</div> somewhere in your listing template, add the following snippet to the header.php or footer.php section and replace "" with your domain:

<script async type="text/javascript"> 
function loadDynamicCategories() {

    $.getJSON('', function(data) {
        $.each(data, function(index) {
    		$('#categories_wrapper ul').append('<li id="'+data[index].cat_id+'"><a href="'+data[index].url+'">'+data[index].cat_name+'</a></li>');

    // add optional link to store home page at the top
    $('#categories_wrapper ul').prepend('<li><a href="'+'[[ebay_store_url]]'+'">Store Home</a></li>');


function loadjQuery() {
    var head    = document.getElementsByTagName("head")[0];
    var script  = document.createElement("script");
    script.type = "text/javascript";
    script.src  = "//";

function waitUntiljQueryIsLoaded() {
    if ( typeof window.jQuery !== 'undefined' && window.jQuery ) {
        if (typeof jQueryLoaded == 'function') {
    } else {
        window.setTimeout( waitUntiljQueryIsLoaded, 100 );

// payload - executed when jQuery has been loaded
function jQueryLoaded() {
        // load categories

// init


View script on GitHub:

This will first load jQuery from the Cloudflare CDN, then load your categories via AJAX from your site and add them as an unordered list (<ul><li>) to the wrapper <div> tag.

Please note that while many sellers and even third party services use external javascript libraries like jQuery in their eBay listings, the official eBay listing policy still states that loading external javascript code is prohibited. So use it on your own risk.

For more information on that subject see  this post on The code above is partly based on their implementation.

Still need help? Contact Us Contact Us