Skip to content

Commit

Permalink
Fix/cta form (#172)
Browse files Browse the repository at this point in the history
* delete hotjar and amplitude, add simple analytics

* delete amplitude tracking
  • Loading branch information
ail3ngrimaldi authored Aug 28, 2024
1 parent 3284519 commit 0b1edeb
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 125 deletions.
47 changes: 3 additions & 44 deletions _layouts/landing.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,14 @@
<link rel="stylesheet" href="/css/variables.css">
<script defer data-domain="virto.network" src="https://plausible.io/js/script.js"></script>

<script>
// Google Tag Manager
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W8MP4KWQ');
</script>

<script>
// Facebook Pixel
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '959806772386614');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=974289180798824&ev=PageView&noscript=1"
/></noscript>

<script>
// Hotjar
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:4973006,hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt="" referrerpolicy="no-referrer-when-downgrade"/></noscript>
<meta name="sa-verify" content="24virtonetwotg" />

<!-- Amplitude -->
<script src="https://cdn.amplitude.com/libs/analytics-browser-2.7.1-min.js.gz"></script><script src="https://cdn.amplitude.com/libs/plugin-session-replay-browser-1.2.0-min.js.gz"></script>
<script src="https://cdn.amplitude.com/libs/plugin-autocapture-browser-0.9.0-min.js.gz"></script>
<script>window.amplitude.init('88119dfbd18136240ad8303dc877b6a8');window.amplitude.add(window.sessionReplay.plugin({sampleRate: 1}));window.amplitude.add(window.amplitudeAutocapturePlugin.plugin());</script>

</head>

<body class="hidden">

<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W8MP4KWQ"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
{% include "navlanding.liquid" %}
<main>{{ page.content }}</main>
<a href="#footer" class="scroll-down-link dark-olive-text center-arrow">Ir al final
Expand Down
71 changes: 34 additions & 37 deletions landings/a/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -131,42 +131,39 @@ ul li, .auto-grid li { display: flex; align-items: center; }

{% endfor %}


<script>
let url = new URL(window.location.href);
url.searchParams.set('b', 'b-one');
window.history.pushState({}, '', url);
window.document.onload = () => { window.amplitude.track(`view:landing:a`); }
let cta = document.querySelectorAll(".track-cta");
cta.forEach((c) => {
c.addEventListener('click', () => {
let newWindow = window.open();
let searchParams = new URL(window.location.href).searchParams;
window.amplitude.track(`landing:a:click-apply`);
let url = `https://waitlist.virto.network/?b=${searchParams.get('b')}`;
newWindow.location = url;
})
document.addEventListener('DOMContentLoaded', function() {
let url = new URL(window.location.href);
url.searchParams.set('b', 'b-one');
window.history.pushState({}, '', url);
let cta = document.querySelectorAll(".track-cta");
cta.forEach((c) => {
c.addEventListener('click', (event) => {
event.preventDefault();
let searchParams = new URL(window.location.href).searchParams;
let url = `https://waitlist.virto.network/?b=${searchParams.get('b')}`;
window.location.href = url;
});
});
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
const addViewedClass = ([e], ob) => {
e.target.classList.add('viewed');
ob.unobserve(e.target);
};
const whenVisible = (elements, fn, opts) => {
const ob = new IntersectionObserver(fn, opts);
$$(elements).forEach(e => ob.observe(e));
};
const makeSticky = ([br]) =>
br.target.nextElementSibling.classList.toggle('fixed', br.intersectionRatio === 1);
whenVisible('main>section', addViewedClass, { threshold: 0.2 });
whenVisible('.sticky-hack', makeSticky, { threshold: [0, 1] });
});
const $ = document.querySelector.bind(document),
$$ = document.querySelectorAll.bind(document);
const addViewedClass = ([e], ob) => {
e.target.classList.add('viewed');
ob.unobserve(e.target);
};
const whenVisible = (elements, fn, opts) => {
const ob = new IntersectionObserver(fn, opts);
$$(elements).forEach(e => ob.observe(e));
};
const makeSticky = ([br]) =>
br.target.nextElementSibling.classList.toggle('fixed', br.intersectionRatio === 1);
whenVisible('main>section', addViewedClass, { threshold: 0.2 });
whenVisible('.sticky-hack', makeSticky, { threshold: [0, 1] });
</script>
</script>
38 changes: 16 additions & 22 deletions landings/b/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -140,42 +140,36 @@ ul li, .auto-grid li { display: flex; align-items: center; gap: 1.75em; }

{% endfor %}


<script>
document.addEventListener('DOMContentLoaded', function() {
let url = new URL(window.location.href);
url.searchParams.set('b', 'b-two');
window.history.pushState({}, '', url);
window.document.onload = () => { window.amplitude.track(`view:landing:b`); }
let cta = document.querySelectorAll(".track-cta");
cta.forEach((c) => {
c.addEventListener('click', () => {
let newWindow = window.open();
let searchParams = new URL(window.location.href).searchParams;
window.amplitude.track(`landing:a:click-apply`);
let url = `https://waitlist.virto.network/?b=${searchParams.get('b')}`;
newWindow.location = url;
})
c.addEventListener('click', (event) => {
event.preventDefault();
let searchParams = new URL(window.location.href).searchParams;
let url = `https://waitlist.virto.network/?b=${searchParams.get('b')}`;
window.location.href = url;
});
});
const $ = document.querySelector.bind(document),
$$ = document.querySelectorAll.bind(document);
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
const addViewedClass = ([e], ob) => {
e.target.classList.add('viewed');
ob.unobserve(e.target);
e.target.classList.add('viewed');
ob.unobserve(e.target);
};
const whenVisible = (elements, fn, opts) => {
const ob = new IntersectionObserver(fn, opts);
$$(elements).forEach(e => ob.observe(e));
const ob = new IntersectionObserver(fn, opts);
$$(elements).forEach(e => ob.observe(e));
};
const makeSticky = ([br]) =>
br.target.nextElementSibling.classList.toggle('fixed', br.intersectionRatio === 1);
br.target.nextElementSibling.classList.toggle('fixed', br.intersectionRatio === 1);
whenVisible('main>section', addViewedClass, { threshold: 0.2 });
whenVisible('.sticky-hack', makeSticky, { threshold: [0, 1] });
</script>
});
</script>
39 changes: 17 additions & 22 deletions landings/c/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -137,41 +137,36 @@ ul li, .auto-grid li { display: flex; align-items: center; gap: 1.75em; }

{% endfor %}


<script>
document.addEventListener('DOMContentLoaded', function() {
let url = new URL(window.location.href);
url.searchParams.set('b', 'b-three');
window.history.pushState({}, '', url);
window.document.onload = () => { window.amplitude.track(`view:landing:b`); }
let cta = document.querySelectorAll(".track-cta");
cta.forEach((c) => {
c.addEventListener('click', () => {
let newWindow = window.open();
let searchParams = new URL(window.location.href).searchParams;
window.amplitude.track(`landing:a:click-apply`);
let url = `https://waitlist.virto.network/?b=${searchParams.get('b')}`;
newWindow.location = url;
})
});
const $ = document.querySelector.bind(document),
$$ = document.querySelectorAll.bind(document);
cta.forEach((c) => {
c.addEventListener('click', (event) => {
event.preventDefault();
let searchParams = new URL(window.location.href).searchParams;
let url = `https://waitlist.virto.network/?b=${searchParams.get('b')}`;
window.location.href = url;
});
});
const $ = document.querySelector.bind(document);
$$ = document.querySelectorAll.bind(document);
const addViewedClass = ([e], ob) => {
e.target.classList.add('viewed');
ob.unobserve(e.target);
e.target.classList.add('viewed');
ob.unobserve(e.target);
};
const whenVisible = (elements, fn, opts) => {
const ob = new IntersectionObserver(fn, opts);
$$(elements).forEach(e => ob.observe(e));
const ob = new IntersectionObserver(fn, opts);
$$(elements).forEach(e => ob.observe(e));
};
const makeSticky = ([br]) =>
br.target.nextElementSibling.classList.toggle('fixed', br.intersectionRatio === 1);
whenVisible('main>section', addViewedClass, { threshold: 0.2 });
whenVisible('.sticky-hack', makeSticky, { threshold: [0, 1] });
});
</script>

0 comments on commit 0b1edeb

Please sign in to comment.