# Hoe moeten CMP's worden ingezet in het licht van script tags voor templates en JS API die gemoderniseerd worden

**URL:** https://meta.discourse.org/t/how-should-cmps-be-deployed-in-light-of-script-tags-for-templates-and-js-api-being-modernized/376684
**Category:** Support
**Tags:** advertising
**Created:** [31 juli 2025 om 09:59 UTC](https://meta.discourse.org/t/how-should-cmps-be-deployed-in-light-of-script-tags-for-templates-and-js-api-being-modernized/376684 "2025-07-31T09:59:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gasroom](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@gasroom](https://meta.discourse.org/u/gasroom)
#### Post date: [31 juli 2025 om 09:59 UTC](https://meta.discourse.org/t/how-should-cmps-be-deployed-in-light-of-script-tags-for-templates-and-js-api-being-modernized/376684/1 "2025-07-31T09:59:47Z")

</div>

In light of [this announcement](https://meta.discourse.org/t/modernizing-inline-script-tags-for-templates-js-api/366482) (Modernizing inline script tags for templates & JS API), script type =’text/discourse-plugin or script type=’text/x-handlebars’ have been deprecated.

However, it is essential in the EU & UK to have a CMP (consent management platform), in order to collect for ads and tracking.

This includes AdSense, GAM, Google Analytics and most other vendors. Without a CMP, almost no ads will show and site owners will be breaking privacy and consent laws.

What is the best practice for implementing CMP script moving forward?

Previously I had code in the header but I now receive admin errors and it seems this will get nuked in September. An example of the code I am using below:

 ![Screenshot 2025-07-31 at 11.02.07](https://global.discourse-cdn.com/meta/original/4X/b/0/e/b0e6bbc1aaefd5af4df5f376218340312492fcba.png)

My site is [gasroom.org](http://gasroom.org)

Thank you!

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [31 juli 2025 om 10:07 UTC](https://meta.discourse.org/t/how-should-cmps-be-deployed-in-light-of-script-tags-for-templates-and-js-api-being-modernized/376684/2 "2025-07-31T10:07:20Z")

</div>

U kunt deze code verplaatsen naar het tabblad ‘JS’ in een thema (onder ‘CSS/HTML bewerken’), zonder de scripttags. Plaats deze code binnen het `apiInitializer`-gedeelte.

U kunt vervolgens `Discourse.user.current()` wijzigen in iets als `api.getCurrentUser()`.
