Skip to content

Commit

Permalink
feat: add tracking code RTR
Browse files Browse the repository at this point in the history
  • Loading branch information
gion-andri committed Jan 4, 2024
1 parent c9f1408 commit 72afb9e
Show file tree
Hide file tree
Showing 7 changed files with 188 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
</div>

<app-footer/>

<app-tracking-rtr/>
</div>
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import { NoEventsComponent } from './components/events/no-events/no-events.compo
import { ScrollableTitleDirective } from './shared/directives/scrollable-title.directive';
import { FilterScrollPositionDirective } from './shared/directives/filter-scroll-position.directive';
import { PwaInstallInstructionsComponent } from './components/pwa-install-instructions/pwa-install-instructions.component';
import { TrackingRtrComponent } from './components/tracking-rtr/tracking-rtr.component';

export function jwtOptionsFactory(authService: AuthenticationService) {
return {
Expand Down Expand Up @@ -113,6 +114,7 @@ export function inIframe() {
ScrollableTitleDirective,
FilterScrollPositionDirective,
PwaInstallInstructionsComponent,
TrackingRtrComponent,
],
imports: [
BrowserModule,
Expand Down
Empty file.
Empty file.
21 changes: 21 additions & 0 deletions src/app/components/tracking-rtr/tracking-rtr.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { TrackingRtrComponent } from './tracking-rtr.component';

describe('TrackingRtrComponent', () => {
let component: TrackingRtrComponent;
let fixture: ComponentFixture<TrackingRtrComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [TrackingRtrComponent]
});
fixture = TestBed.createComponent(TrackingRtrComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
23 changes: 23 additions & 0 deletions src/app/components/tracking-rtr/tracking-rtr.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Component, ElementRef, Inject, PLATFORM_ID, Renderer2 } from '@angular/core';
import { isPlatformBrowser } from '@angular/common';

@Component({
selector: 'app-tracking-rtr',
templateUrl: './tracking-rtr.component.html',
styleUrls: ['./tracking-rtr.component.scss']
})
export class TrackingRtrComponent {
constructor(
@Inject(PLATFORM_ID) private readonly platformId: Object,
private readonly renderer: Renderer2,
private readonly el: ElementRef,
) {
// BROWSER
if (isPlatformBrowser(this.platformId)) {
const script = this.renderer.createElement('script') as HTMLScriptElement;
script.src = `/assets/tracking/tc_SRGGD_53.js`;
script.async = true;
this.renderer.appendChild(this.el.nativeElement, script);
}
}
}
140 changes: 140 additions & 0 deletions src/assets/tracking/tc_SRGGD_53.js

Large diffs are not rendered by default.

0 comments on commit 72afb9e

Please sign in to comment.