A
A
anderius2015-11-03 13:22:09
Yii
anderius, 2015-11-03 13:22:09

Where should I place the Google Analytics code in the website code?

There is a page code on the yii engine. You need to add the Google Analytics code ga('send', 'event', 'category', 'action'); to the appearance of the message “Your data has been entered into the database” (at the end of the code), so that accounting takes place. They asked for help, but I'm not very good at code. Just started to get interested, but you need to do it quickly. Probably everything is quite simple. "Poke method" did not work, syntax errors. Thanks in advance!

<div style="width:750px; min-height:620px;">

    <div class="menu-left">
        <?php 
           $this->widget('zii.widgets.CMenu',array('items'=> $model->getLeftMenuItems($id),));
        ?>
    </div>
    <!-- leftmenu -->

    <div class="text-with-menu">
    <?php
      echo '<h3>'.$model->getTitle($id).'</h3>';
      if(!$offermodel->addRecord) {
    
      echo '<div class="form" id="feedback_form">';

      $form=$this->beginWidget('CActiveForm', array(
        'id'=>'offer',
        'enableClientValidation'=>true,
        'clientOptions'=>array('validateOnSubmit'=>true, 'validateOnChange' => true,),
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
      ));

        echo $offermodel->type;
        echo '<p class="note">Поля отмеченные <span class="required">*</span> необходимо заполнить.</p>';

        echo $form->errorSummary($offermodel);

        echo '<div class="row">';
          echo $form->labelEx($offermodel,'phone'); 
          echo $form->textField($offermodel,'phone'); 
          echo $form->error($offermodel,'phone'); 
        echo '</div>';

        echo '<div class="row">';
          echo $form->labelEx($offermodel,'email');
          echo $form->textField($offermodel,'email');
          echo $form->error($offermodel,'email');
        echo '</div>';

        echo '<div class="row">';
          echo $form->labelEx($offermodel,'name');
          echo $form->textField($offermodel,'name');
          echo $form->error($offermodel,'name');
        echo '</div>';

        echo '<div class="row">';
          echo $form->labelEx($offermodel,'lettertext');
          echo $form->textArea($offermodel,'lettertext');
          echo $form->error($offermodel,'lettertext');
        echo '</div>';

        echo '<div class="row">';
          echo $form->labelEx($offermodel,'doc');
          echo $form->fileField($offermodel,'doc');
          echo $form->error($offermodel,'doc');
        echo '</div>';




          if(CCaptcha::checkRequirements()) { 
            echo '<div class="row">';
            echo $form->labelEx($offermodel,'verifyCode'); 
            echo '<div>';
            $this->widget('CCaptcha'); 
            echo '</div>';
            echo $form->textField($offermodel,'verifyCode'); 
            echo '<div class="hint">Пожалуйста, введите буквы, которые показаны на картинке выше.';
            echo '<br/>Буквы не чувствительны к регистру.</div>';
            echo $form->error($offermodel,'verifyCode'); 
            echo '</div>';
          }


        echo '<div class="row buttons">';
          echo CHtml::submitButton('Отправить');
        echo '</div>';

        $this->endWidget();
        echo '</div>';
      } else {
        echo 'Ваши данные занесены в базу.';
      }

      ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
javanub, 2015-11-03
@anderius

after the footer so that the page is fully loaded

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question