Skip to content

Commit

Permalink
Add AB test for blog text
Browse files Browse the repository at this point in the history
  • Loading branch information
nkalupahana committed Mar 7, 2024
1 parent dd6ec20 commit a2abf9d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions _includes/cta.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="cta">
<h4>{{ include.title | default:"Start journaling today" }}</h4>
<p>
<h4 id="cta-title">{{ include.title | default:"Start journaling today" }}</h4>
<p id="cta-desc">
baseline is a 100% free, non-profit operated, journaling and mood tracking service that's
designed to help people better understand their mental health by building a journaling habit.
</p>
Expand Down
13 changes: 11 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ <h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}
<div>
<div class="sticky-box baseline-callout">
<img src="/assets/therapy-sidebar.jpg" alt="Person using phone to journal" class="sidebar-image" />
<h3 class="sidebar-heading">Better mental health, within your reach</h3>
<p>Journaling is proven to improve mental health &mdash; and baseline makes it easy. Start today, 100% free and private.</p>
<h3 id="sidebar-heading" class="sidebar-heading">Better mental health, within your reach</h3>
<p id="sidebar-desc">Journaling is proven to improve mental health &mdash; and baseline makes it easy. Start today, 100% free and private.</p>
<a id="blog_sidebar_clicked" href="/" class="baseline-button">Learn More</a>
</div>
</div>
Expand Down Expand Up @@ -114,4 +114,13 @@ <h3 class="sidebar-heading">Better mental health, within your reach</h3>
localStorage.setItem("utm_source", "blog");
localStorage.setItem("utm_campaign", '{{ page.title | downcase | split: " " | join: "_"}}');
}

posthog.onFeatureFlags(() => {
if (posthog.getFeatureFlag('new-blog-wording') === 'test') {
document.getElementById("sidebar-heading").innerHTML = "Take charge of your mental health";
document.getElementById("sidebar-desc").innerHTML = "Take the first step towards a healthier, happier life with baseline, a 100% free and private journaling app.";
document.getElementById("cta-title").innerHTML = "<b>Take charge of your mental health with baseline</b>";
document.getElementById("cta-desc").innerHTML = "baseline is a 100% free, non-profit operated app that takes a whole new approach to journaling.";
}
})
</script>
5 changes: 5 additions & 0 deletions _sass/blog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@
.post-preview-image {
grid-area: image;
border-radius: 8px;
}

#cta-title {
margin-bottom: 4px;
line-height: 125%;
}

0 comments on commit a2abf9d

Please sign in to comment.