Skip to content
Kévin Legrand edited this page Nov 1, 2020 · 2 revisions

Installation with github

In order to install tarteaucitron, the first step is to download the latest version from the github repo.

For its, follow this link or from the official website follow this path: Installation guide -> Free manual installation -> GitHub

Then click on the "Source code" file of the most recent version (or the desired version) in order to download it.

__

Once the archive has been downloaded you can extract it wherever you want in your project, you will then have a folder called tarteaucitron.js-(version).

The folder looks like this (for current version 1.5):

📁tarteaucitron.js-1.5

→ 📁css

→ 📁lang

→ 📄.gitignore

→ 📄advertising.js

→ 📄LICENSE

→ 📄package.json

→ 📄README.md

→ 📄tarteaucitron.js

→ 📄tarteaucitron.services.js

* For this example, the tartaucitron folder is placed in the project's assets folder.

In the tag <head> </head> of your HTML add this line:

<script type="text/javascript" src="/assets/tarteaucitron.js-1.5/tarteaucitron.js"></script>

Now that tarteaucitron is installed, the next step will be initialization.

OPTIONAL :

tarteaucitron.services.js

tarteaucitron includes services already integrated which allows us not to have to create them to manage our cookies.

the services already integrated: https://tarteaucitron.io/fr/install/

These pre-registered services are present in tarteaucitron.services.js, in order to lighten the code you can therefore delete the services that you do not use ;)

Path to tarteaucitron.js-1.5

By default, the tarteaucitron.js file looks for additional files (css, lang, advertising.js, ...) in its current folder, if you want to move the tarteaucitron.js file to another folder or if for any other reason you get the error:

tarteaucitron.js:1488 GET "chemin erroné"/lang/tarteaucitron.fr.js?v=20200730 net::ERR_ABORTED 404 (Not Found)

You can correct this by indicating the path of the tarteaucitron.js-(version) folder using the tarteaucitronForceCDN variable.

Add to line 1 of tarteaucitron.js: tarteaucitronForceCDN = 'yourpath/tarteaucitron.js-(folder)'


Previous page - Next page