Our company uses a third-party service for our career / job site, allowing users to submit job postings. Initially, users land on an external platform that blends in well with GTM. Inside the CMS, you can easily add GTM code to the header and body area. However, as soon as the user clicks “apply” in the job description, he is redirected to the web application, which is essentially a separate system. Unfortunately, this second system does not allow you to add code to the header or footer. However, I can add the code to the thank you page that users see when they submit the application.
On the thank you page, the only way to insert GTM code is to use WYSIWYG. You cannot paste code into <head> , but you can paste it into <body> . I know this is not perfect, but this is the only option.
Even if I can get the code to render on the page, it doesn't work at all. It does not record pageviews, the Google Tag Assistant does not see the code, and the Google GTM toolbar does not appear when the GTM container is in preview mode.
From what I can say, the page does not refresh when the user submits the application. So, I guess this is the reason the tag is not working. I tried using several different triggers based on the recommendations I read on the Internet, but no one solved the problem.
I just use the standard GTM code, but I will always write my code below:
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','###');</script>
NOTE. I also use the <noscript> code immediately after the <script> code.