Blog

Latest News, Updates, Tutorials and much more

Download and host JavaScript files

Sometimes it is faster and more reliable to store JavaScript files on your own server, usually same place as the website itself. This also allows web developers to edit JavaScript files directly and make changes on the fly.

For this purpose, we have created an option to download your generated JavaScript files, edit them and host them on your servers.

How to download a JavaScript file?

You can download the JS file from your account page by clicking the “Download” button next to a proper cookie script item.

download-menu

Editable JS file – should be used if you want to edit the file yourself before putting it on your website. It is written in a readable way, so a web developer could add necessary changes.

Minified JS file – should be used if you are not going to add any changes. This file takes slightly less space so it can be read by visitors faster.

Choose a proper file and it will start downloading:

download

How to upload a file to your server?

You can upload files to any folder on your website or to a root of web directory. This can be done using an FTP client or any other method you use to upload files.

How to use files on your website?

Once you upload the file to your server, you can include it on your website. You can include the JS file in the header or just before closing the </body> tag. Here is an example of how to include JavaScript files to your website:

<script type="text/javascript" src="/903e0d0491c903e0d0491c903e0d0491c.js"></script>

If the file is placed in the root website directory. Change the file name to the one you have uploaded. Or:

<script type="text/javascript" src="/includes/903e0d0491c903e0d0491c903e0d0491c.js"></script>

If the file is placed in the “includes” directory.

You can change the file name to your own if you need.

Note that if you decide to download and host a JavaScript file yourself, it can’t be updated automatically by cookie-script anymore. This means that no changes to cookie script items (ex. pop-up title, description, or custom colors) will take effect by themselves. To apply new changes, you have to re-download the JavaScript file and re-upload it on your server.

This feature is available in selected pricing plans. See our Pricing plans for more details.

New to CookieScript?

CookieScript helps to make the website ePrivacy and GDPR compliant.

We have all the necessary tools to comply with the latest privacy policy regulations: third-party script management, consent recording, monthly website scans, automatic cookie categorization, cookie declaration automatic update, translations to 34 languages, and much more.