Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

913
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!