Skip to content

Commit

Permalink
Tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola Lanzilotto committed Oct 6, 2023
1 parent 2c34616 commit c36eec5
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 15 deletions.
4 changes: 3 additions & 1 deletion src/app/auth/signin/signin.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export class SigninComponent implements OnInit {
this.logger.log('[SIGN-IN] email ', this.userForm.value['email'])
this.auth.signin(this.userForm.value['email'], this.userForm.value['password'], this.appConfigService.getConfig().SERVER_BASE_URL, (error, user) => {
if (!error) {
// this.localDbService.removeFromStorage('signedup')
// console.log('[SIGN-IN] SSO (Signin) - user', user);
// this.localDbService.removeFromStorage('hpea');
if (!isDevMode()) {
Expand Down Expand Up @@ -308,7 +309,8 @@ export class SigninComponent implements OnInit {
try {
window['analytics'].track('Signed In', {
"username": userFullname,
"userId": user._id
"userId": user._id,
'method': "Email and Password"
});
} catch (err) {
this.logger.error('track signin event error', err);
Expand Down
2 changes: 2 additions & 0 deletions src/app/auth/signup/signup.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ export class SignupComponent implements OnInit, AfterViewInit {
this.logger.log('[SIGN-UP] Lastname ', this.userForm.value['lastName']);
this.logger.log('[SIGN-UP] POST DATA ', signupResponse);
if (signupResponse['success'] === true) {

// this.localDbService.setInStorage('signedup', 'true')
// this.router.navigate(['/welcome']);
this.logger.log('[SIGN-UP] RES ', signupResponse);
const userEmail = signupResponse.user.email
Expand Down
6 changes: 5 additions & 1 deletion src/app/bots/templates/templates.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ <h2 weight="normal" class="template-name template-card-title">
<div class="css-1pwjctj cmnty-tmplt-content"
*ngIf="template.tags">
<div class="css-1limyoz cmnty-tmplt-tag-wpr"
*ngFor="let tag of template.tags">
*ngFor="let tag of template.tags | slice:0:3; let i=index">
<div class="css-14z49fr cmnty-tmplt-tag">
<div
class="css-53dz3e cmnty-tmplt-tag-content-wpr">
Expand All @@ -539,6 +539,10 @@ <h2 weight="normal" class="template-name template-card-title">
</div>
</div>
</div>

</div>
<div *ngIf="template?.tags?.length > 3">
+ {{ template?.tags?.length - 3 }}
</div>


Expand Down
21 changes: 20 additions & 1 deletion src/app/components/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ export class NavbarComponent implements OnInit, AfterViewInit, AfterContentCheck
this.router.events
.subscribe((event: NavigationEvent) => {
if (event instanceof NavigationEnd) {
// console.log('[NAVBAR] NavigationEnd ', event.url);
console.log('[NAVBAR] NavigationEnd ', event.url);

/** HIDE THE PLAN NAME IF THE ROUTE ACTIVE IS THE HOME */
if (event.url.indexOf('/home') !== -1) {
Expand Down Expand Up @@ -616,6 +616,7 @@ export class NavbarComponent implements OnInit, AfterViewInit, AfterContentCheck


this.router.events.subscribe((val) => {

if (this.location.path() !== '') {
this.route = this.location.path();
// this.logger.log('»> »> »> NAVBAR ROUTE DETECTED »> ', this.route)
Expand Down Expand Up @@ -648,6 +649,22 @@ export class NavbarComponent implements OnInit, AfterViewInit, AfterContentCheck
// this.logger.log('»> »> »> NAVBAR ROUTE DETECTED »> ', this.route, 'HIDE PENDING_EMAIL_NOTIFICATION ', this.HIDE_PENDING_EMAIL_NOTIFICATION)
}

// const navigationEndVal = val instanceof NavigationEnd
// console.log('[NAVBAR] navigationEndVal ' ,navigationEndVal )

// if (navigationEndVal) {
// const hasSignedup = this.localDbService.getFromStorage('signedup')
// console.log('[NAVBAR] hasSignedup ', hasSignedup)
// if (hasSignedup) {
// this.HIDE_PENDING_EMAIL_NOTIFICATION = true;

// console.log('[NAVBAR] HIDE_PENDING_EMAIL_NOTIFICATION ' ,this.HIDE_PENDING_EMAIL_NOTIFICATION )
// }
// }




// if (this.route === '/login') {
// this.logger.log('»> »> »> NAVBAR ROUTE DETECTED »> ', this.route)
// // this.DETECTED_LOGIN_PAGE = true;
Expand All @@ -667,6 +684,8 @@ export class NavbarComponent implements OnInit, AfterViewInit, AfterContentCheck
// }
}
});


}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/app/core/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1369,9 +1369,10 @@ export class AuthService {
}
// Segments
try {
window['analytics'].track('Signed In Sign in with Google', {
window['analytics'].track('Signed In', {
"username": userFullname,
"userId": user._id
"userId": user._id,
'method': "Sign in with Google"
});
} catch (err) {
this.logger.error('track Sign in with Google event error', err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,18 +354,19 @@ export class HomeCreateChatbotComponent implements OnInit, OnChanges {
} else if (this.use_case_for_child === 'increase_online_sales') {
this.router.navigate(['project/' + this.projectId + '/bots/templates/increase-sales']);
} else if (this.use_case_for_child === undefined) {
this.trackUserAction.emit({action:'Explore Templates', actionRes: 'All' })
this.router.navigate(['project/' + this.projectId + '/bots/templates/all']);
}
localStorage.setItem('wawizard', 'hookbot')
}

goToIncreaseSalesTemplates() {
// this.trackUserAction.emit({action:'Home', actionRes: 'Explore Increase Sales Templates' })
this.trackUserAction.emit({action:'Explore Templates', actionRes: 'Increase Sales' })
this.router.navigate(['project/' + this.projectId + '/bots/templates/increase-sales']);
}

goToCustomerSatisfactionTemplates() {
// this.trackUserAction.emit({action:'Home',actionRes: 'Explore Customer Satisfaction Templates' })
this.trackUserAction.emit({action:'Explore Templates', actionRes: 'Customer Satisfaction' })
this.router.navigate(['project/' + this.projectId + '/bots/templates/customer-satisfaction']);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@
<div class="home-block-description" style="padding-right:55px">
Connect your WhatsApp Business to organize your campaign and to easily receive and reply to WhatsApp
messages from the Tiledesk chat
<span class="home-block-display-wa-wizard"
*ngIf="(solution_channel_for_child === 'web_mobile' && whatsAppIsInstalled && userHasClickedDisplayWAWizard !== true)"
<!-- <span class="home-block-display-wa-wizard"
*ngIf="(solution_channel_for_child === 'whatsapp_fb_messenger' && whatsAppIsInstalled && userHasClickedDisplayWAWizard !== true)"
(click)="displayWhatsAppWizard()">
Display the wizard to connect WhatsApp
</span>
</span> -->
</div>


whatsAppIsInstalled > {{whatsAppIsInstalled }}
whatsAppIsConnected > {{whatsAppIsConnected }}
<!-- whatsAppIsInstalled > {{whatsAppIsInstalled }}
whatsAppIsConnected > {{whatsAppIsConnected }} -->
<div class="actions-btn-wpr">
<!-- whatsAppIsInstalled > {{whatsAppIsInstalled }} -->
<!-- {{'Uninstall' | translate}}-->
Expand Down
10 changes: 7 additions & 3 deletions src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,8 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
this.logger.log('[HOME] - trackUserAction ', event);
const userAction = event.action
const userActionRes = event.actionRes
this.logger.log('[HOME] - trackUserAction userAction', userAction);
this.logger.log('[HOME] - trackUserAction userActionRes', userActionRes);
console.log('[HOME] - trackUserAction userAction', userAction);
console.log('[HOME] - trackUserAction userActionRes', userActionRes);
const trackObjct = {
"type": "organic",
"username": userFullname,
Expand Down Expand Up @@ -663,7 +663,11 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
trackObjct['button'] = "Connect"
}

this.logger.log('[HOME] - trackUserAction trackObjct', trackObjct);
if (userAction === 'Explore Templates' && userActionRes !== null) {
trackObjct['category'] = userActionRes
}

console.log('[HOME] - trackUserAction trackObjct', trackObjct);
if (!isDevMode()) {
try {
window['analytics'].track(userAction, trackObjct);
Expand Down

0 comments on commit c36eec5

Please sign in to comment.