T
T
Tutucu2020-12-26 12:55:37
JavaScript
Tutucu, 2020-12-26 12:55:37

How to insert YAN advertising banner code in Vue?

Hello everyone, you need to insert the Yandex ad banner code in the Vue.js component:

<!-- Yandex.RTB R-A-702382-1 -->
<div id="yandex_rtb_R-A-702382-1"></div>
<script type="text/javascript">
    (function(w, d, n, s, t) {
        w[n] = w[n] || [];
        w[n].push(function() {
            Ya.Context.AdvManager.render({
                blockId: "R-A-702382-1",
                renderTo: "yandex_rtb_R-A-702382-1",
                async: true
            });
        });
        t = d.getElementsByTagName("script")[0];
        s = d.createElement("script");
        s.type = "text/javascript";
        s.src = "//an.yandex.ru/system/context.js";
        s.async = true;
        t.parentNode.insertBefore(s, t);
    })(this, this.document, "yandexContextAsyncCallbacks");
</script>

I can’t figure out how to do this, I didn’t find an API for this. Can you suggest?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Swert, 2020-12-26
@Tutucu

A similar question was

A
aleksei91, 2021-02-08
@aleksei91

Did you manage to launch an advertising banner?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question