Skip to main content
Passing information to HTML ad

Do you need to pass macros to your HTML ad? Pass any other information from DSP to your HTML ad?

Updated over a week ago

Accessing macros in your HTML container

Nexd tags have the possibility to access macros in HTML container โ€“ via Javascript.

In all Nexd tag environments you are able to access tag variables via window.nexd.options object.

E.g.

Having a tag:

<ins class="adcads"
data-adc-id="LIVEID"
data-unit="LIVEID"
data-clickable="yes"
data-redir="yes"
data-click-tracker="%%CLICK_URL_UNESC%%https://www.nexd.com/example"
data-click-macro="%%CLICK_URL_UNESC%%"
data-responsive="yes"
data-width="640"
data-height="360"
data-macro-Var1="MyMacroVariable1"
data-macro-Var2="MyMacroVariable2">
<script src="https://media.adcanvas.com/LIVEID/adtag.js" type="text/javascript"></script>
</ins>

You can use in HTML:

<html>
<head>
</head>
<body>
...
<script>
var nexdAPI = window.nexd.options;
var clickTracker = nexdAPI.clicktracker;
var adWidth = nexdAPI.width;
var adHeight = nexdAPI.height;
var yourMacroVariable1 = nexdAPI.macrovar1;
var yourMacroVariable2 = nexdAPI.macrovar2;
</script>
</body>
</html>

If you have any questions or request changes to the functionality, please reach out to [email protected].

Did this answer your question?