Settings component
This is how you can embed our settings component into your own website:
-
Include script:
-
Put the following tag in your page:
<adstate-settings-component></adstate-settings-component>Available attributes:
-
- Name:
language - Type:
string - Description: Use this to set the current language.
- Name:
-
- Name:
color - Type:
string - Description: Use this to set the theme color (hex code).
- Name:
-
You can also control the component with some events
adstate-settings-cookie-pop-up-open: will open the cookie pop-up.adstate-settings-cookie-pop-up-delete: will delete the cookies set by the settings component.
The component also fires one event:
-
changeLanguage: whenever the language changes this triggers. Checkevent.detailto get the new language.
For example like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Our website</title>
</head>
<body>
<nav>
<img src="logo.jpg" alt="">
<ul>
<li><a href="#1">Link 1</a></li>
<li><a href="#2">Link 2</a></li>
<li><a href="#3">Link 3</a></li>
</ul>
</nav>
<main>
<adstate-settings-component language="nb_NO" color="#3d9c64">
</adstate-settings-component>
</main>
<footer>
<p>Page footer © Copyright 2021</p>
</footer>
<script src="https://embed.adstate.com/settings-component.js"></script>
</body>
</html>