Skip to content

Commit 104a30c

Browse files
committed
moving function/styling to new branch
1 parent fa91bb6 commit 104a30c

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

src/_sass/components/_markdown.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,3 +475,24 @@ div.highlighter-rouge {
475475
font-weight: bold;
476476
margin-left: 3px
477477
}
478+
479+
.sample-code-container {
480+
display: grid;
481+
grid-template-columns: 1fr 1fr;
482+
grid-gap: 20px;
483+
}
484+
485+
.output {
486+
outline: 1px solid color(gray-600);
487+
outline-offset: 4px
488+
}
489+
.output-code {
490+
display: block;
491+
font: 12px color(code-gray) "Droid Sans Mono", "Lucida Console", "Monaco", monospace;
492+
word-wrap: break-word;
493+
}
494+
495+
.form {
496+
outline: 1px solid color(gray-600);
497+
outline-offset: 4px
498+
}

src/connections/spec/best-practices-identify.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,56 @@ analytics.page({
5858
})
5959
```
6060

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+
61111
<!---[Page Call](https://user-images.githubusercontent.com/78389005/214352835-5c3f7f28-af28-428e-bb8a-88ad39d53b46.png)--->
62112

63113
You can see in this full page event, the `anonymousId` is populated, and the `userId` is null.

0 commit comments

Comments
 (0)