A Javascript App is a simple javascript tag that can be loaded on the front-end of the store. This functionality is useful to integrate external applications, like chats, newsletters forms, visitor tracking tools, on a store without manipulating any HTML code. With javascript you can easily add new components to the store and you can add or change the HTML/CSS without touching the store theme.

Add a Javascript Tag to a Store

You need to have a general Jumpseller app created to be able to add a javascript tag to a store. Make sure you read the article on how to create a general Jumpseller App.

To install the javascript tag on a Jumpseller store, a POST request shall be performed:

curl -X POST "https://api.jumpseller.com/v1/jsapps?login=XXXXX&authtoken=XXXXX"

with the following JSON content:

{ "app" :
  {
    "app_code" : 'Code of your App created above. E.g. mailchimp, olark, googleshopping',
    "url"      : 'URL of the javascript. E.g. https://example/test.js',
    "template" : 'Theme Template of to Inject the HTML. E.g. layout, home, product, etc',
    "element"  : 'HTML element to inject. E.g. head or body'
  }
}

A Jumpseller app can include several javascript tags on the same store. If you add a javascript tag for a Jumpseller app on the same template and element where one already exists, the previous one is replaced.

If you need to include several javascripts tags on the same location or you need to include CSS or any assets with the script, you can easily use a package manager like Webpack and bundle everything together for fast loading times.

Other useful API endpoints

To list all the javascript tags installed on the store by a Jumpseller app:

GET https://api.jumpseller.com/v1/jsapps/APP_CODE?login=XXXXX&authtoken=XXXXX

To destroy a javascript tag installed on the store by a Jumpseller app:

DELETE https://api.jumpseller.com/v1/jsapps/APP_CODE?login=XXXXX&authtoken=XXXXX

{ "app" :
  {
    "template" : 'Theme Template where the Javascript App is installed on the HTML. E.g. layout, home, product, etc',
    "element"  : 'HTML element where is injected. E.g. head or body'
  }
}