DShultz
DShultz

Reputation: 4541

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:

<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.

I have set up an HTTP Request tag in this container and pointed it at the functional 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.

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. The call gets made server-side, but nothing is done with the returned javascript.

Upvotes: 0

Views: 1886

Answers (1)

Arturo C
Arturo C

Reputation: 21

I suggest you take a look at the following article: 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.

Upvotes: 2

Related Questions