The magnews code
When you activate a web property, magnews automatically generates its magnews code, which looks similar to the following:
<script src="https://example.com/nl/mnt/31da3g97becc84.js"></script>The website only includes a reference to a JavaScript file. The entire web property configuration is automatically loaded by magnews using the configured settings.
This is the recommended approach because it always keeps the web property configuration aligned with the code installed on your website.
Track a page view
To track a page view without recording a conversion, add a script similar to the following to the page where you want to track the event:
<script type="text/javascript">
mna('page');
</script>
The page view tracking script is the one that contains the page event, and it must be placed after the magnews code.
Manual configuration of the magnews code
We recommend modifying the code manually only if you have advanced requirements and understand the implications of doing so.
If you need to customize the magnews code itself, open the URL specified in the src attribute of the magnews code in your browser.
This gives you the complete JavaScript code, for example:
(function (m, a, g, n, e, w, s) {
m[e] = m[e] || function () {
(m[e].q = m[e].q || []).push([arguments[0], arguments[1], 1 * (new Date()).getTime()]);
};
w = a.createElement(g),
s = a.getElementsByTagName(g)[0];
w.async = 1;
w.src = n;
s.parentNode.insertBefore(w, s);
}) (window, document, 'script', '//example.com:443/nl/mna1784654784100a204195.js', 'mna');
mna('init', {
"apikey":"31da3g97becc84",
"trackerhostname":"example.com:443",
"userIdentityTimeout":21600,
"cookiedomain":"example.com",
"trackanonymous":true,
"enableWebdisplay":true,
"firePageEvent":true,
"pageEventParams":{}
});This is the exact code executed by the browser, where you can modify the parameters.