diff --git a/README.md b/README.md index 2cd12a2..e33b4a3 100644 --- a/README.md +++ b/README.md @@ -119,3 +119,23 @@ tarteaucitron.init({ }); ``` + +# Create custom service +```js +tarteaucitron.services.mycustomservice = { + "key": "mycustomservice", + "type": "social|analytic|ads|video|support", + "name": "MyCustomService", + "needConsent": true, + "cookies": ['cookie', 'cookie2'], + "readmoreLink": "/custom_read_more", // If you want to change readmore link + "js": function () { + "use strict"; + // When user allow cookie + }, + "fallback": function () { + "use strict"; + // when use deny cookie + } +}; +``` \ No newline at end of file diff --git a/tarteaucitron.js b/tarteaucitron.js index 8ce944c..0f2afda 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -413,12 +413,17 @@ var tarteaucitron = { html += '