Administrators can add custom CSS or JavaScript to Sharetribe marketplaces. With this feature, you can customize the way your marketplace works or looks, and can add third-party scripts (such as the Google Search Console verification or a Facebook tracking pixel code).

Custom scripts are added to the <head> tag of each page in your marketplace.
Custom scripts are active on all pages, for all users (whether they are logged in or not). Custom scripts are not active in pages of the admin panel.

This feature can be dangerous and should only be used by administrators who know what they are doing. In a worst-case scenario, your marketplace might be unable to load and be unavailable for users. Some technical knowledge is required to write custom code.

NOTE: Modifications made with custom scripts might break with page layout changes. As custom scripts can modify any part of the page, we have no way to guarantee that it will continue to work when changes are made to Sharetribe. Keep this in mind and use this with caution.

Due to the reasons mentioned above, custom scripts should only be used carefully. If you're trying to change the way Sharetribe works, we're always listening to ideas, so contact us!

Add a custom script

  1. Log in to your marketplace as an administrator.
  2. Open the admin panel.
  3. Open the "Design" tab.
  4. Paste your script into the "Custom script" text box.
  5. Click "Save settings".

That's it—our custom code is now active and set! Changes are applied immediately.

Find help to write your Custom Script

If you don't have technical knowledge yourself, you can hire a freelancer or company. Any person with HTML, CSS and JavaScript skills would be able to help.

You can find great people with such skills on websites such as Upwork.

Custom script field size

The custom script field content is stored into a MySQL database in a TEXT field type. This means that the allowed size for this field is roughly 64 Kilobytes (or about 65,535 characters). This can vary a bit because of encoding though.

If you plan to add longer scripts, you should consider hosting them in a separate file on your own https server or file hosting.

Importing resources from third-party providers

For security purposes, Sharetribe uses SSL certificates with the HTTPS protocol in all marketplaces. If you want to include files that are hosted on third-party sites, they need to be included over HTTPS as well.

What do to if your custom code breaks things

If the code you add produces errors, your marketplace may not work for users. If you are unable to fix the custom code, remove it to get things working again:

  1. Log in your marketplace as an administrator.
  2. Open the Admin panel.
  3. Open the "Design" tab.
  4. Remove all code from the "Custom script" text box.
  5. Click "Save settings".

If you can't load or log in to your marketplace, please contact Sharetribe support.

Did this answer your question?