Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 428cfb3

Browse files
author
vikasrohit
committed
SUP-758, [Registration] Analytics
-- utm params are now being passed as state params to an from login-registration pages -- utm params are now being passed to register API call under param field of the payload
1 parent 3c6ad4b commit 428cfb3

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

app/account/account.routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
'login': {
3131
parent: 'auth',
32-
url: '/login/?next&code&state&status&userJWTToken',
32+
url: '/login/?next&code&state&status&userJWTToken&utm_source&utm_medium&utm_campaign',
3333
params: { 'notifyReset': false },
3434
data: {
3535
title: 'Login'
@@ -51,7 +51,7 @@
5151
},
5252
'register': {
5353
parent: 'auth',
54-
url: '/register/?next',
54+
url: '/register/?next&utm_source&utm_medium&utm_campaign',
5555
data: {
5656
title: "Join"
5757
},

app/account/register/register.controller.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
$log = $log.getInstance("RegisterController");
1010
$log.debug("-init");
1111
var vm = this;
12+
// prepares utm params, if available
13+
var utm = {
14+
source : $stateParams && $stateParams.utm_source ? $stateParams.utm_source : '',
15+
medium : $stateParams && $stateParams.utm_medium ? $stateParams.utm_medium : '',
16+
campaign : $stateParams && $stateParams.utm_campaign ? $stateParams.utm_campaign : ''
17+
};
1218

1319

1420
// Set default for toggle password directive
@@ -39,9 +45,9 @@
3945
country: {
4046
name: vm.country
4147
},
42-
utmSource: '',
43-
utmMedium: '',
44-
utmCampaign: ''
48+
utmSource: utm.source,
49+
utmMedium: utm.medium,
50+
utmCampaign: utm.campaign
4551
};
4652

4753
if (!vm.isSocialRegistration) {

0 commit comments

Comments
 (0)