File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
dashboard/app/views/pd/application/teacher_application Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Section3TeachingBackground from './Section3TeachingBackground';
6
6
import Section4ProfessionalLearningProgramRequirements from './Section4ProfessionalLearningProgramRequirements' ;
7
7
import Section5AdditionalDemographicInformation from './Section5AdditionalDemographicInformation' ;
8
8
import Section6Submission from './Section6Submission' ;
9
+ /* global ga */
9
10
10
11
export default class Teacher1920Application extends FormController {
11
12
static propTypes = {
@@ -48,4 +49,13 @@ export default class Teacher1920Application extends FormController {
48
49
// Let the server display a confirmation page as appropriate
49
50
window . location . reload ( true ) ;
50
51
}
52
+
53
+ /**
54
+ * @override
55
+ */
56
+ onSetPage ( newPage ) {
57
+ // Report a unique page view to GA.
58
+ ga ( 'set' , 'page' , '/pd/application/teacher/' + newPage + 1 ) ;
59
+ ga ( 'send' , 'pageview' ) ;
60
+ }
51
61
}
Original file line number Diff line number Diff line change @@ -52,10 +52,16 @@ export default class FormController extends React.Component {
52
52
}
53
53
54
54
componentWillMount ( ) {
55
+ let newPage ;
55
56
if ( this . constructor . sessionStorageKey && sessionStorage [ this . constructor . sessionStorageKey ] ) {
56
57
const reloadedState = JSON . parse ( sessionStorage [ this . constructor . sessionStorageKey ] ) ;
57
58
this . setState ( reloadedState ) ;
59
+ newPage = reloadedState . currentPage ;
60
+ } else {
61
+ newPage = this . state . currentPage ;
58
62
}
63
+
64
+ this . onSetPage ( newPage ) ;
59
65
}
60
66
61
67
/**
@@ -168,6 +174,13 @@ export default class FormController extends React.Component {
168
174
// Intentional noop; overridden by child classes
169
175
}
170
176
177
+ /**
178
+ * Called when we set a new page.
179
+ */
180
+ onSetPage ( newPage ) {
181
+ // Intentional noop; overridden by child classes
182
+ }
183
+
171
184
/**
172
185
* Submit serialized form data to the specified API Endpoint and handle server
173
186
* response
@@ -400,6 +413,8 @@ export default class FormController extends React.Component {
400
413
} ) ;
401
414
402
415
this . saveToSessionStorage ( { currentPage : newPage } ) ;
416
+
417
+ this . onSetPage ( newPage ) ;
403
418
}
404
419
}
405
420
Original file line number Diff line number Diff line change 12
12
= link_to 'https://code.org/educate', 'https://code.org/educate'
13
13
for additional resources and opportunities to connect with other computer science educators.
14
14
Thank you for supporting computer science for all!
15
+
16
+ :javascript
17
+ $ (document ).ready (function () {
18
+ // Report a unique page view to GA.
19
+ ga (' set' , ' page' , ' /pd/application/teacher/submitted' );
20
+ ga (' send' , ' pageview' );
21
+ });
You can’t perform that action at this time.
0 commit comments