Hello,
the code for block 1 is inserted twice as configured.
Once in the upper part in the post and second time few paragraphs below.
However, both of your ad codes use div
and JS reference with the same id 633268495:
<script type="text/javascript">
window._mNHandle = window._mNHandle || {};
window._mNHandle.queue = window._mNHandle.queue || [];
medianet_versionId = "3121199";</script>
<script src="//contextual.media.net/dmedianet.js?cid=8CU462VC5" async="async">
</script>
<div id="633268495">
<script type="text/javascript">
try {
window._mNHandle.queue.push(function () {
window._mNDetails.loadTag("633268495", "300x250", "633268495");
});
}
catch (error) {}
</script>
</div>
This id should be unique – only one ad code should use it.
Since the seccond ad code loads ads for id 633268495 both ads are loaded for the first instance where the first div with this id is found.
I suggest to use another block for the second insertion with ad code using different (unique) IDs.
The ID is present 3 times in the AD code – you need to change all 3 instances.
ADVANCED APPROACH with single block
Alternatively, there is a way to make unique IDs in a single block.
You can use shortcode [ADINSERTER counter="block"]
.
This shortcode returns number which corresponds to the insertion counter for this block (1 for the first insertion, 2 for the second one,…)
You can try this code (not tested):
<script type="text/javascript">
window._mNHandle = window._mNHandle || {};
window._mNHandle.queue = window._mNHandle.queue || [];
medianet_versionId = "3121199";</script>
<script src="//contextual.media.net/dmedianet.js?cid=8CU462VC5" async="async">
</script>
<div id="633268495-[ADINSERTER counter="block"]">
<script type="text/javascript">
try {
window._mNHandle.queue.push(function () {
window._mNDetails.loadTag("633268495-[ADINSERTER counter="block"]", "300x250", "633268495-[ADINSERTER counter="block"]");
});
}
catch (error) {}
</script>
</div>
This approach is normally used for Ad Manager ads:
https://adinserter.pro/documentation/ad-manager-ads
You can use custom CSS to define custom margins:
https://adinserter.pro/documentation/alignments-and-styles#custom-css
https://adinserter.pro/documentation/code-preview