Add the MarkTag to your web application
- Install and init MarkTag Script to your web application
<script>
window.mtrem = window.mtrem || [];
function mtag() {
mtrem.push(arguments);
}
mtag("init", "{{TAG_DOMAIN}}?tagId={{TAG_ID}}", { consent: true });
mtag("event", { type: "ViewContent" });
</script>
<script async type="text/javascript" src="{{TAG_DOMAIN}}/script"></script>Make sure to replace and with your marktag domain and Tag ID from https://beta.markopolo.ai/ or the Partners API.
Done! You are now able to log events with MarkTag. The ViewContent event will fire immediately when the page loads, tracking page views across your site.
Important: Consent Management
The consent parameter in the initialization should be controlled by your existing consent management system if you have one. We recommend integrating this with your consent banner:
// Example: Integration with your consent management
const userConsent = getUserConsentStatus(); // Your consent logic
mtag("init", "{{TAG_DOMAIN}}?tagId={{TAG_ID}}", { consent: userConsent });⚠️ Legal Notice: In most jurisdictions, setting consent: true in production without obtaining actual user consent may not be legally compliant. Always follow local privacy laws (GDPR, CCPA, etc.) when implementing tracking.
Markopolo currently doesn't ship with a built-in consent banner, but it's in our roadmap. Until then, please use your existing consent management solution or implement one that complies with your local regulations.