Skip to content

Commit

Permalink
fix(ga): set userId on setUsername
Browse files Browse the repository at this point in the history
Dispatch ```ga('set', 'userId', userId)``` on ```angulartics2.setUsername.next(userId)```
  • Loading branch information
JonnyBGod authored Mar 12, 2018
1 parent c45564b commit c567845
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/providers/ga/angulartics2-ga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ export class Angulartics2GoogleAnalytics {

setUsername(userId: string) {
this.angulartics2.settings.ga.userId = userId;
if (typeof ga === 'undefined') {
return;
}
ga('set', 'userId', userId);
}

setUserProperties(properties: any) {
Expand Down

0 comments on commit c567845

Please sign in to comment.