# Optimization of CMP and GTM Loading

Loading the CMP (Consent Management Platform) and GTM (Google Tag Manager) into a single script, as proposed by Sirdata, offers several advantages:

* **Preventing CMP Implementation Errors**: Integrating both tools into a single script ensures that the consent rules defined by the CMP are properly respected and applied, reducing the risk of configuration errors.
* **Better Script Ordering**: Combining the CMP, GTM, and Google Consent Mode V2 in one script ensures that scripts load and execute in the correct order, providing better management of user consent and tracking events.
* **Improved Web Performance**: Loading the CMP and GTM in a single script optimizes page load time, reduces the number of requests, and improves the overall performance of your website.

This method provides an efficient solution to maximize compliance and performance while simplifying the implementation of consent and tracking tools.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://server-side.docs.sirdata.net/sirdata-server-side/english-1/f.a.q-server-side/performance/optimization-of-cmp-and-gtm-loading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
