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
<div class="test">
<p-button label="Submit" (onClick)="onSubmit()" styleClass="full-btn"></p-button>
</div>
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
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXX-X');
</script>