@@ -58,6 +58,56 @@ analytics.page({
58
58
})
59
59
```
60
60
61
+ <script src =" https://cdnjs.cloudflare.com/ajax/libs/prism/9000.0.1/prism.min.js " integrity =" sha512-UOoJElONeUNzQbbKQbjldDf9MwOHqxNz49NNJJ1d90yp+X9edsHyJoAs6O4K19CZGaIdjI5ohK+O2y5lBTW6uQ== " crossorigin =" anonymous " referrerpolicy =" no-referrer " ></script >
62
+ <link rel =" stylesheet " href =" https://cdnjs.cloudflare.com/ajax/libs/prism/9000.0.1/themes/prism.css " integrity =" sha512-EaMmVtm5YHQNg4u9UXGOueWP6nyUtCpKZojcE4Rqt/6ifpzzzuQVMTffvo8FVj4xDG04gIyWm1z1b7GqELl1eQ== " crossorigin =" anonymous " referrerpolicy =" no-referrer " />
63
+ <script type =" text/javascript " >
64
+ function showMessage (){
65
+ var email = document .getElementById (" email" ).value ;
66
+ var fname = document .getElementById (" fname" ).value ;
67
+ var lname = document .getElementById (" lname" ).value ;
68
+ var output = ` analytics.identify({
69
+ firstName: '${ fname} ',
70
+ lastName: '${ lname} ',
71
+ email: '${ email} '
72
+ }) `
73
+ output_container .innerHTML = output
74
+ Prism .highlightElement (output_container)
75
+ }
76
+ </script >
77
+ <script >
78
+ function showOutput () {
79
+ var show = document .getElementById (" output-code" );
80
+ if (show .style .display === " block" ) {
81
+ show .style .display = " none" ;
82
+ } else {
83
+ show .style .display = " block" ;
84
+ }
85
+ }
86
+ </script >
87
+
88
+ <div class =" sample-code-container " >
89
+ <div class =" form " >
90
+ <h3 > Web Form </h3 >
91
+ <p ><b >Newsletter Signup</b ></p >
92
+ <label for =" fname " >First Name:</label >
93
+ <input type =" text " id =" fname " ><br >
94
+ <label for =" lname " >Last Name:</label >
95
+ <input type =" text " id =" lname " ><br >
96
+ <label for =" email " >Email:</label >
97
+ <input type =" text " id =" email " ><br >
98
+ <input type =" submit " id =" submit " onclick =" showMessage (); showOutput ()" value =" Submit " >
99
+ </div >
100
+
101
+ <div class =" output " >
102
+ <h3 >Sample Identify Call</h3 >
103
+ <!-- <div class="output-code" id="output-code" style="display:none"> -->
104
+ <pre class =" language-javascript " ><code class =" language-javascript " id =" output_container " >
105
+
106
+ </code ></pre >
107
+ <!-- </div> -->
108
+ </div >
109
+ </div >
110
+
61
111
<!-- -[Page Call](https://user-images.githubusercontent.com/78389005/214352835-5c3f7f28-af28-428e-bb8a-88ad39d53b46.png)--->
62
112
63
113
You can see in this full page event, the ` anonymousId ` is populated, and the ` userId ` is null.
0 commit comments