File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,11 @@ const awsconfig = {
9
9
"aws_kinesis_firehose_stream_name" : "ClickStreamKinesisFirehose-OGX7PQdrynUo" ,
10
10
} ;
11
11
12
- const RUNTIME = "python"
12
+ const RUNTIME = "java"
13
+ const BASE_ORIGIN = "awslabs.github.io"
13
14
14
- const attachListeners = ( ) => {
15
+ function enableSearchOnBlurElement ( ) {
16
+ if ( document . location . hostname != BASE_ORIGIN ) return // prevent unnecessary data
15
17
/* Register handler to log search on blur */
16
18
document . addEventListener ( "DOMContentLoaded" , function ( ) {
17
19
recordPageView ( {
@@ -23,7 +25,6 @@ const attachListeners = () => {
23
25
// If Search result is ever actionable
24
26
// we should populate `value`
25
27
if ( this . value ) {
26
- let path = document . location . pathname ;
27
28
console . info ( `Search value: ${ this . value } ` )
28
29
recordPageView ( {
29
30
searchPattern : this . value
@@ -41,6 +42,10 @@ const attachListeners = () => {
41
42
} ;
42
43
}
43
44
45
+ const attachListeners = ( ) => {
46
+ enableSearchOnBlurElement ( )
47
+ }
48
+
44
49
const init = ( ) => {
45
50
Analytics . addPluggable ( new KinesisFirehoseProvider ( ) )
46
51
Amplify . configure ( awsconfig ) ;
@@ -68,4 +73,4 @@ const recordPageView = ({prevLocation, searchPattern}) => {
68
73
} , 'AWSKinesisFirehose' )
69
74
}
70
75
71
- init ( )
76
+ init ( )
You can’t perform that action at this time.
0 commit comments