Gridbox Store App Released

Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

Google Tag Manager in Forms

3 years 10 months ago #1

  • Alma's Avatar
  • Alma
  • Posts: 30
Hi, i need to put the google tag code in the header of the thank you page, how can i do that?

3 years 10 months ago #2

  • Network24's Avatar
  • Network24
  • Posts: 25
Hi Alma,

you can just add the code to your Thank You article. You will need to disable your editor first, otherwise the editor will remove the code.

On the form settings, just redirect to your Thank You page when submitted.

3 years 10 months ago #3

  • Alma's Avatar
  • Alma
  • Posts: 30
i have no thank you article, im using just the message from your forms, i would like to add it to the button of submit, let me know how to add it. thank you.

3 years 10 months ago #4

  • Network24's Avatar
  • Network24
  • Posts: 25
You cant add this sort of thing to the submit button. I am assuming you are trying to insert google conversion tracking on your form correct?

You will need to create a joomla article with your Thank You message. Inside that article you add the google conversion tracking code, including the
<script>
tags.

But before you add the code, you must disable the joomla WYSIWYG editor, because it will delete the script code when you Save.

After you create the article, goto your Form and under Settings (top right corner button) at the bottom you will see a Redirect text field. Insert your Thank You article's link in there.

Your visitors will still see the PopUp confirmation when they submit, then will be redirected to your Thank You page, where your conversion code will trigger.

3 years 10 months ago #5

  • Alma's Avatar
  • Alma
  • Posts: 30
Hi, i'm not using google analytics, i'm using google tag manager and i need to insert a code after the head and another one after body tag

3 years 10 months ago #6

  • Network24's Avatar
  • Network24
  • Posts: 25
Sorry I am not a google expert. I thought Tag Manager was a new way to manage and combine all of your tracking tags?!

In any case, if they must be on the Thank You page, your only option is my suggestion above. Create a Thank You article and redirect users after form submissions.

if you need to insert anything inside the head section, (between <head> and </head>) you will need to modify your template's index.php file.

can you give me an example of the tags you have to insert? so that I can tell you for certain if its safe to put through joomla article, or if they must be put in index.php.
if they start and end with <script> they are safe to add inside joomla article.


Also, please note, that I am not a dev here at Balbooa, I am just a very satisfied customer. I saw your post and wanted to try to help. =)

3 years 10 months ago #7

  • Alma's Avatar
  • Alma
  • Posts: 30
This is suponed to be in the head

<!-- Google Tag Manager -->
<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=
'www.googletagmanager.com/gtm.js?id='+i+d...de.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-54HN8Q');</script>
<!-- End Google Tag Manager -->


and this in the body

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="www.googletagmanager.com/ns.html?id=GTM-54HN8Q"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

3 years 10 months ago #8

  • Network24's Avatar
  • Network24
  • Posts: 25
Hi Alma,

Yes, tags like those can be put inside joomla articles no problem. The only requirement is you MUST turn off the editor when you add them.


What you need to do, is think about which google tags "must be on every page", those tags will need to be put inside your template's index.php
This will make those tags appear on every page in your joomla site.

-- but--
if you need a tag to appear "only on one page" for example the Thank You page, you will need to add the tag inside a joomla article.


I hope this makes sense. if not let me know and i'll try to explain with more detail.
Powered by Kunena Forum