Skip to content

Commit

Permalink
Fix bad timed redirection, checking that airtable connection still works
Browse files Browse the repository at this point in the history
  • Loading branch information
ail3ngrimaldi committed Sep 5, 2024
1 parent 49728c7 commit a3a469e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 49 deletions.
30 changes: 14 additions & 16 deletions landings/a/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,20 @@ ul li, .auto-grid li { display: flex; align-items: center; gap: 2em; }

<script>
window.document.onload = () => {
let url = new URL(window.location.href);
url.searchParams.set('b', 'b-one');
window.history.pushState({}, '', url);
window.amplitude.track(`view:landing:a`);
let cta = document.querySelectorAll(".track-cta");
cta.forEach((c) => {
c.addEventListener('click', () => {
let searchParams = new URL(window.location.href).searchParams;
let w = window.open('_blank');
w.location = url;
window.amplitude.track(`landing:a:click-apply`);
url = `https://waitlist.virto.network/?b=${searchParams.get('b')}`;
});
});
window.amplitude.track('view:landing:a');
function handleCtaClick(event) {
event.preventDefault();
let redirectUrl = new URL('https://waitlist.virto.network/');
redirectUrl.searchParams.set('b', 'b-one');
window.amplitude.track('landing:a:click-apply')
window.open(redirectUrl.toString(), '_blank');
}
let ctas = document.querySelectorAll('.track-cta');
ctas.forEach((cta) => {
cta.addEventListener('click', handleCtaClick);
});
let telegram = document.getElementById("telegram");
telegram.addEventListener('click', () => {
Expand Down
32 changes: 15 additions & 17 deletions landings/b/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -142,22 +142,20 @@ ul li, .auto-grid li { display: flex; align-items: center; gap: 1.75em; }
{% endfor %}

<script>
window.document.onload = () => {
let url = new URL(window.location.href);
url.searchParams.set('b', 'b-two');
window.history.pushState({}, '', url);
window.amplitude.track(`view:landing:b`);
let cta = document.querySelectorAll(".track-cta");
cta.forEach((c) => {
c.addEventListener('click', () => {
let searchParams = new URL(window.location.href).searchParams;
let w = window.open('_blank');
w.location = url;
window.amplitude.track(`landing:b:click-apply`);
url = `https://waitlist.virto.network/?b=${searchParams.get('b')}`;
});
document.addEventListener('DOMContentLoaded', function() {
window.amplitude.track('view:landing:b');
function handleCtaClick(event) {
event.preventDefault();
let redirectUrl = new URL('https://waitlist.virto.network/');
redirectUrl.searchParams.set('b', 'b-two');
window.amplitude.track('landing:b:click-apply')
window.open(redirectUrl.toString(), '_blank');
}
let ctas = document.querySelectorAll('.track-cta');
ctas.forEach((cta) => {
cta.addEventListener('click', handleCtaClick);
});
let telegram = document.getElementById("telegram");
Expand Down Expand Up @@ -190,5 +188,5 @@ window.document.onload = () => {
whenVisible('main>section', addViewedClass, { threshold: 0.2 });
whenVisible('.sticky-hack', makeSticky, { threshold: [0, 1] });
};
});
</script>
30 changes: 14 additions & 16 deletions landings/c/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,20 @@ ul li, .auto-grid li { display: flex; align-items: center; gap: 1.75em; }

<script>
window.document.onload = () => {
let url = new URL(window.location.href);
url.searchParams.set('b', 'b-three');
window.history.pushState({}, '', url);
window.amplitude.track(`view:landing:c`);
let cta = document.querySelectorAll(".track-cta");
cta.forEach((c) => {
c.addEventListener('click', () => {
let searchParams = new URL(window.location.href).searchParams;
let w = window.open('_blank');
w.location = url;
window.amplitude.track(`landing:c:click-apply`);
url = `https://waitlist.virto.network/?b=${searchParams.get('b')}`;
});
});
window.amplitude.track('view:landing:c');
function handleCtaClick(event) {
event.preventDefault();
let redirectUrl = new URL('https://waitlist.virto.network/');
redirectUrl.searchParams.set('b', 'b-three');
window.amplitude.track('landing:c:click-apply')
window.open(redirectUrl.toString(), '_blank');
}
let ctas = document.querySelectorAll('.track-cta');
ctas.forEach((cta) => {
cta.addEventListener('click', handleCtaClick);
});
let telegram = document.getElementById("telegram");
telegram.addEventListener('click', () => {
Expand Down

0 comments on commit a3a469e

Please sign in to comment.