consetgo consent module documentation /
Custom scripts
In the “Custom scripts” section of the Services and scripts tab you add your own JavaScript that is not on the site yet and does not belong to any known service. The module inserts it itself, only after consent to the chosen category. GTM, GA4, Meta Pixel, TikTok, Hotjar and LinkedIn are added with the “Code” field of the service, not here.

- Expand “Add script”, enter the “Script name” and paste the JavaScript into “Script code (without <script> tags)”.
- Choose the “Consent category” and click “Add script”. Added scripts appear in the table above the form.
- Above the table switch on “Add scripts configured in the panel”. It appears once the panel has at least one service code or custom script. Without it the codes do not reach the site. The switch also applies to codes entered for services; a code entered in the “Code” field switches it on by itself.
“Code” field, custom script or manually added service?
| “Code” field | Custom script | Add service manually | |
|---|---|---|---|
| Where | At the service, after expanding its row | “Custom scripts” section | Form at the bottom of the tab |
| When | A GTM, GA4, Meta Pixel, TikTok, Hotjar or LinkedIn code is not on the site and you want to add it | Your own JavaScript is not on the site and you want to add it | The code is already on the site, but the scanner does not know it |
| What the module does | Inserts the service code after consent | Inserts your code after consent to the chosen category | Blocks code from the given addresses until consent |
Known services that are already on the site (GA4, GTM, Meta Pixel…) need none of these – the scanner finds them. The “Code” field and a manually added service show the service to visitors in the banner and in the cookie policy.
You can also paste a pixel or the tag of a known service as a custom script, but the “Code” field is better. The service then has a name, provider, purpose and the note about transfers outside the EEA in the banner and the cookie policy, the duplicate tag alert works, the ID is checked and the category can only be marketing. A custom script shows only the name you typed and lets you choose “Necessary” by mistake – then it loads without consent.
Izmēģiniet consetgo savā vietnē
14 dienas bez maksas. Instalēšana aizņem dažas minūtes.
Izmēģiniet 14 dienas bez maksas