Uncaught ReferenceError: googletag is not defined

4.1k Views Asked by At

Doubleclick for Publishers (DFP) Version: 8.x-1.x-dev

We are using DFP module in our D8 application and DFP ad blocks work fine within site. We are showing them as blocks on multiple pages, even we embeded ad blocks in twig files and they worked fine.

We have widgets for third party sites. When we render dfp ad block in widget's block twig file and use that widget in any third party site, ad does not render and it starts giving Uncaught ReferenceError: googletag is not defined.

1

There are 1 best solutions below

3
On

Are you instantiating the googletag script in the html beforehand?

If it is already being instantiated and still undefined, I would recommend a new call similar to this user's commit.

https://github.com/alaborderie/ng2-ad-dfp/commit/fd25b0463db1cd8cdfc81e64b5f604cce7770dc5