Custom scripting

Edit layout, texts, and more on your Go marketplace by using JavaScript, CSS or HTML.

Updated over a week ago

Administrators can add custom JavaScript, CSS and HTML 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).

The Custom script feature is available with any paid plan.

The custom scripts can be added to three different sections:

  • the <head> tag of each page in your marketplace.

  • the <body> tag of each page in your marketplace.

  • the CSS 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 your 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 your Admin panel.

  3. Open the "Advanced / Custom script" tab.

  4. Paste your script into the relevant text area.

  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 fields content is stored in a MySQL database in TEXT field types. This means that these fields' allowed size 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 to do 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 to your marketplace as an administrator.

  2. Open your Admin panel.

  3. Open the "Advanced / Custom script" tab.

  4. Remove all code from the relevant "Custom script" field.

  5. Click "Save settings".

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

Did this answer your question?