/
React

Usercentrics - PUBLIC

React

React is mostly used ad the “view” component in the MVC architecture in which the UI could be updated without going back to the server to obtain a new view.

React is mostly used ad the “view” component in the MVC architecture in which the UI could be updated without going back to the server to obtain a new view.

To create a new React project, run on the terminal:

npx create-react-app my-app

To run the newly created app, on the terminal go to the my-app directory and run on the terminal:

npm start

We assume that you have node.js installed on your computer.


Assuming that you have a React App already working, you can implement our Usercentrics Script in the following way:

CMPv1 Implementation

  • Open index.html inside the public directory

  • Add the following script to the <head> tag:

    //Change 'xxxxxx' to your settingsID <script> window["usercentrics"] = { settingsId: 'xxxxxx', settingsVersionOverwrite: 'preview', }; </script> <script type="application/javascript" src="https://app.usercentrics.eu/latest/main.js" async></script>

CMPv2 Implementation

  • Open index.html inside the public directory

  • Add the following script to the <head> tag:


Do you need further help?

How can I get help with technical questions?

 

Related content

React Implementierung
React Implementierung
More like this
Usercentrics WordPress Implementation Guide
Usercentrics WordPress Implementation Guide
More like this
English FAQ Section
English FAQ Section
Read with this
Angular
More like this
How can I test if the Smart Data Protector (SDP) is blocking technologies?
How can I test if the Smart Data Protector (SDP) is blocking technologies?
Read with this
Nuxt.js
More like this

Usercentrics - PUBLIC