L
L
lexstile2019-05-30 11:14:08
contextual advertising
lexstile, 2019-05-30 11:14:08

How to place multiple RTB blocks on one page?

There is a call code:

(function(w, d, n, s, t) {
    w[n] = w[n] || [];
    w[n].push(function() {
      Ya.Context.AdvManager.render({
        blockId: "R-A-320500-1",
        renderTo: "yandex_rtb_R-A-320500-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");

How can I add a second RTB block to this call?
Several similar calls, I believe, are wrong to use, and I tried - it did not help - one is displayed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Graty, 2020-03-31
@Graty

If you put it on one page, then yes, it’s easier to make different blocks at once and not suffer, but if you need to insert it into autoload, then it’s more difficult here. The Yandex documentation does not help here at all. In fact, even Yandex support immediately sends to freelancers, and the issue itself does not solve. You just need to write an additional script in the block code so that the blocks understand the difference between the pages. Then there will be no duplicate. If you have an infinite load in WordPress, I can help. Now all modern themes, including scrolling, do + - the same way. Therefore, you can simply copy the added code from the example and paste it into your blocks. An example of an infinite scrolling feed: https://tabulo.ru/samye-poleznye-dlja-zdorovja-vid...There are two blocks in the sidebar, and two in the article. You can simply copy and paste your block number and site ID. Everything should work. PS does not work on autoload pages made via Ajax Auto Load, only for topics with a built-in function (now in 2020 almost all of them)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question