• Priority: 0
  • Status: Closed
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 04.03.21, 16:26
  • Opened by: Domingo Andreu
  • Closed by: Anonymous Submitter
  • Closed on:
  • Reason: Not a bug

Ticket #20959 - Google Tag

Hello, im installing Google Tag but i dont know where to install the <head> tag and the <body> tag. I read your documentation:

How to add Google Analytics/Tag Manager’s Code
Get your code from Google
Open the file /themes/alysum/templates/_partials/javascript.tpl
Add your code to the end of the file
add {literal} tag around yor code like this:
<script src=”https://www.googletagmanager.com/gtag/js?id=UA-39464434“></script>
<script>
{literal}

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-39464434-1');

{/literal}
</script>

This is OK for Analytics but is it same for Google TAG?

Doesn’t matter <header> and </body> tags?

Comments

Fred 05 Mar 2021, 11:29

Hi, Domingo Andreu.
1. Yes, it’s the same for google tag
2. You can try a module instead of edit files https://github.com/MSiliunas/Prestashop-GoogleTagManager