Skip to content

Commit

Permalink
Add UTM tags
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Jan 17, 2024
1 parent b69cca3 commit b9b2f6b
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/lib/util/promos/Jan2024.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
<script lang="ts">
const taglines = [
'Try diagramming with ChatGPT at Mermaid Chart',
"Try Mermaid's Visual Editor at Mermaid Chart",
'Enjoy live collaboration with teammates at Mermaid Chart'
];
const taglines = {
announcement_bar_ai_diagramming: 'Try diagramming with ChatGPT at Mermaid Chart',
announcement_bar_visual_editor: "Try Mermaid's Visual Editor at Mermaid Chart",
announcement_bar_live_collaboration: 'Enjoy live collaboration with teammates at Mermaid Chart'
};
const taglineKeys = Object.keys(taglines);
const taglineKey = taglineKeys[Math.floor(Math.random() * taglineKeys.length)];
const tagline = taglines[taglineKey];
const url =
'https://www.mermaidchart.com/?' +
new URLSearchParams({
utm_source: 'mermaid_live_editor',
utm_medium: taglineKey,
utm_campaign: 'promo_2024'
}).toString();
</script>

<a
href="https://www.mermaidchart.com/"
href={url}
target="_blank"
class="tracking-wide flex-grow justify-center align-middle flex gap-6">
{taglines[Math.floor(Math.random() * taglines.length)]}
<button class="font-light text-sm p-1 rounded bg-gray-800 px-4">Try it now</button>
class="flex flex-grow justify-center gap-6 align-middle tracking-wide">
{tagline}
<button class="rounded bg-gray-800 p-1 px-4 text-sm font-light">Try it now</button>
</a>

0 comments on commit b9b2f6b

Please sign in to comment.