Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

915
Visualizações
Google analytics: goal event is not getting triggered from my angular web application

I have created a goal in my google analytics dashboard and tried to trigger that event from my component.But it is not getting reflecting in google analytics dashboard goals section.

FYI-The application is connected fine with the script in index.js. Only issue with the goal event not getting reflected while login to the application.

I have also installed below package,but no change in result.

npm install --save-dev @types/google.analytics

HTML file

<div class="test">
        <p-button label="Submit" (onClick)="onSubmit()" styleClass="full-btn"></p-button>
</div>

ts file

 onSubmit(){
this.isSubmitted = true;
if(this.loginFormGroup.invalid) return;
this.auth.login(this.loginForm.email.value,this.loginForm.password.value).subscribe((user)=>{
  this.authError = false;
  this.localStroageService.setToken(user.token);
  ga('send', 'event', { eventCategory: 'Registration', eventAction: 'click', eventLabel: 'Regtracking', eventValue: 1});// This is not getting triggered

index.html

   <script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-XXXXXX-X');
</script>
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda