Jump to content

SOLVED --- No <head> in header.tpl (Google tag manager installation)


doog_2019

Recommended Posts

Hi everybody 😎

(I am un begginer and I use Prestashop 1.7)

I would like to install Google Tag Manager and put the 2 pieces of code that GTM gives me (one after the <head> and one after the <body>.

 

BUT when I go in my header.tpl wich path is: /www/themes/laber_outstock1/templates/_partials/header.tpl

 

There is no <head> and <body> in the file, as you can see here:

{**
 * 2007-2017 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2017 PrestaShop SA
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *}
{block name='header_banner'}
  <div class="header-banner">
    {hook h='displayBanner'}
  </div>
{/block}

{block name='header_nav'}
  <nav class="header-nav">
    <div class="container">
        <div class="row">
          <div class="hidden-sm-down">
            <div class="left-nav">
              {hook h='displayNav1'}
            </div>
            
          </div>
          <div class="hidden-md-up text-xs-center mobile">
            <div class="pull-xs-left" id="menu-icon">
              <i class="mdi mdi-view-headline" aria-hidden="true"></i>
            </div>
            <div class="pull-xs-right" id="_mobile_cart"></div>
            <div class="pull-xs-right" id="_mobile_wishtlistTop"></div>
           
            <div class="top-logo" id="_mobile_logo"></div>
            <div class="clearfix"></div>
          </div>
        </div>
    </div>
  </nav>
{/block}

{block name='header_top'}
  <div class="header-top">
    <div class="laber-header">
		<div class="container">
			<div class="hidden-sm-down laberLogo" id="_desktop_logo">
			  <a href="{$urls.base_url}">
				<img class="logo img-responsive" src="{$shop.logo}" alt="{$shop.name}">
			  </a>
			</div>
			<div class="dropdown js-dropdown right-nav hidden-sm-down pull-right">
                <span class="expand-more" data-toggle="dropdown">
					<i class="icon ion-navicon"></i>
				</span>
				<div class="dropdown-menu">
					{hook h='displayNav2'}
				</div>
            </div>
			<div class="laberdisplayTop">
				{hook h='displayTop'}
			</div>
			<div class="container_lab_megamenu hidden-sm-down">
				<div class="laberMegamenu">
					<div class="container">
						{hook h='displayMegamenu'}
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="container">
      <div id="mobile_top_menu_wrapper" class="row hidden-md-up" style="display:none;">
        <div class="js-top-menu-bottom">
		  {hook h='displayMegamenuMobile'}
		  {hook h='displayVegamenuMobile'}
		  <div class="pull-xs-right" id="_mobile_user_info"></div>
          <div id="_mobile_currency_selector"></div>
          <div id="_mobile_language_selector"></div>
          <div id="_mobile_contact_link"></div>
        </div>
      </div>
    </div>
  </div>
  {hook h='displayNavFullWidth'}
{/block}

THANK YOU for your help

Edited by doog_2019 (see edit history)
Link to comment
Share on other sites

Hi @Nishith 😊

Thank you for your help, I found the solution to install GTM, I just put my piece of code at the end of header.tpl (for the one supposed to be after <head> tag) and the other one at the end of footer.tpl (for one supposed to be after the <body> tag). 

But do you know why I can't the see the <head> tag in my header.tpl file ? (Beginner question 😂)

Link to comment
Share on other sites

  • 8 months later...
Il 31/8/2019 alle 11:07, doog_2019 ha dichiarato:

Ciao @Nishith  😊

Grazie per il vostro aiuto , ho trovato la soluzione per l'assistenza GTM, ho appena messo il mio pezzo di codice alla fine di header.tpl (per quello che deve essere dopo il tag <head>) e l'altro alla fine del piè di pagina .tpl (per uno che dovrebbe essere dopo il tag <body>). 

Sai perché non riesco a vedere il tag <head> nel mio file header.tpl? (Domanda per principianti  😂 )

Io ho lo stesso tuo problema e non riesco a vedere  il tag <head> nel mio file header.tpl, come devo fare? Ti ringrazio

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...