Skip to content

Commit

Permalink
Changing the a and button elements that run a function to have a href…
Browse files Browse the repository at this point in the history
… of "javascript:void(0)", so GTM registers them as links and fires a `gtm.click` event when they are clicked.
  • Loading branch information
dr-bizz committed Nov 19, 2024
1 parent 88d170f commit e22c08a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class="button"
[ngStyle]="{ 'background-color': buttonBgColor, color: buttonTextColor }"
(click)="formAction()"
href="javascript:void(0)"
>{{ buttonText }}</a
>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ng-container *ngIf="ready">
<div class="linkContent indent">
<a (click)="formAction(events)">{{ linkText }}</a>
<a (click)="formAction(events)" href="javascript:void(0)">{{ linkText }}</a>
</div>
</ng-container>
26 changes: 20 additions & 6 deletions src/app/page/component/tract-page/tract-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,44 @@
<ng-container *ngIf="(dir$ | async) === 'ltr'">
<!-- If not first page -->
<ng-container *ngIf="(isFirstPage$ | async) === false">
<button
<a
(click)="previous()"
href="javascript:void(0)"
class="button button-white far fa-arrow-left"
></button>
><span class="hide"></span
></a>
</ng-container>

<!-- If not last page -->
<ng-container *ngIf="(isLastPage$ | async) === false">
<button (click)="next()" class="button far fa-arrow-right"></button>
<a
(click)="next()"
href="javascript:void(0)"
class="button far fa-arrow-right"
><span class="hide"></span
></a>
</ng-container>
</ng-container>

<ng-container *ngIf="(dir$ | async) === 'rtl'">
<!-- If not first page -->
<ng-container *ngIf="(isLastPage$ | async) === false">
<button (click)="next()" class="button far fa-arrow-left"></button>
<a
(click)="next()"
href="javascript:void(0)"
class="button far fa-arrow-left"
><span class="hide"></span
></a>
</ng-container>

<!-- If not last page -->
<ng-container *ngIf="(isFirstPage$ | async) === false">
<button
<a
(click)="previous()"
href="javascript:void(0)"
class="button button-white far fa-arrow-right"
></button>
><span class="hide"></span
></a>
</ng-container>
</ng-container>
</div>
Expand Down

0 comments on commit e22c08a

Please sign in to comment.