Skip to main content

Integrating "ID Tag"

An ID-Solution Tag is a critical component for publishers seeking to improve the accuracy of audience recognition across devices and environments, enabling better personalization and monetization.

We are providing the metatag file as commonjs and esm module. Including both metatag.js and metatag.mjs ensures compatibility across a wide range of browsers. Older Browsers will only load metatag.js, providing backward compatibility. Modern Browsers will load the more efficient metatag.mjs module file.

This is an minimalistic example how to integrate the ID-Tag into a website. The placeholder "example" needs to be replaced by a publisher identifier. Please note that Ströer will provide the acutal value during the onboarding process.

Option 1: HTML-Integration

Add metatag.js/mjs Scripts via HTML-Tags. This is a classic setup for non-dynamic websites.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>

<script src="https://cdn.stroeerdigitalgroup.de/metatag/live/example/metatag.js" type="text/javascript" async nomodule fetchpriority="high"></script>
<script src="https://cdn.stroeerdigitalgroup.de/metatag/live/example/metatag.mjs" type="module" async fetchpriority="high"></script>
</head>
<body>

</body>
</html>

Option 2: JavaScript-Integration

Add metatag.js/mjs Scripts via JavaScript. Optionally you can execute this script when user has given consent via CMP.

(function(s, t, r, o, e, E, R) {
function createScript(src) {
var e = s.createElement(t);
e.type = 'module';
if (/\.js$/.test(src)) {
e.setAttribute('nomodule', '');
e.type = 'text/javascript';
}
e.setAttribute('fetchpriority', 'high');
e.async = true;
e.src = src;
return e;
}
var c = !!s.location.href.match(/sdgmt=preview/i) ? 'preview' : 'live';
s.head.appendChild(createScript([r,c,o,'metatag.js'].join('/')));
s.head.appendChild(createScript([r,c,o,'metatag.mjs'].join('/')));
})(document, 'script', 'https://cdn.stroeerdigitalgroup.de/metatag', 'example');