[英]Calling a script from Google Tag Manager using a Server-Side container
I have an existing GTM container that works fine calling my existing script:我有一个现有的 GTM 容器,可以很好地调用我现有的脚本:
<script type="text/javascript" src="//myserver.com/td/loader.js"></script>
I want to now execute this exact code using the new Server-Side container in GTM: I have successfully set up a Server-Side container, and can even call it from my page, and see the pageview events successfully.我现在想在 GTM 中使用新的服务器端容器执行这个确切的代码:我已经成功设置了一个服务器端容器,甚至可以从我的页面调用它,并成功查看页面浏览事件。
I have set up an HTTP Request tag in this container and pointed it at the functional URL: https://myserver.com/td/loader.js我在这个容器中设置了一个 HTTP 请求标签,并将它指向功能 URL: https : //myserver.com/td/loader.js
Under "Preview" in GTM, I can see that the HTTP request is being made, but the JavaScript returned never executes.在 GTM 中的“预览”下,我可以看到正在发出 HTTP 请求,但返回的 JavaScript 从未执行。
My question is: What do I have to do to get javascript to execute from a Server-Side container the way it does coming from a regular container executing directly on the page.我的问题是:我该怎么做才能让 javascript 从服务器端容器执行,就像它从直接在页面上执行的常规容器一样。 The call gets made server-side, but nothing is done with the returned javascript.
调用在服务器端进行,但返回的 javascript 没有做任何事情。
I suggest you take a look at the following article: https://www.simoahava.com/analytics/custom-templates-guide-for-google-tag-manager/我建议你看看下面的文章: https : //www.simoahava.com/analytics/custom-templates-guide-for-google-tag-manager/
You can import your own custom template and you will have to write code to be able to read your own js.您可以导入自己的自定义模板,并且必须编写代码才能读取自己的 js。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.