This commit is contained in:
Daniel LaForce 2024-08-01 20:45:36 -06:00
parent 45285a0126
commit 8a61296db8
2 changed files with 35 additions and 19 deletions

2
_redirects Normal file
View File

@ -0,0 +1,2 @@
/redirect/google-maps https://www.google.com/maps/d/u/0/viewer?mid=1uaJCMW64w_zwERr9nFcVJchrZdocNbA&ll=39.035283304733184%2C-105.2908042761522&z=14 301!
/redirect/gaia-gps https://www.gaiagps.com/map/?lat=39.03966489533956&lon=-105.32945964046155&zoom=14&loc=14.0/-105.3120/39.0318&pubLink=VVXcZPvEfvAbvRWi5F0DQPNT&folderId=e810350b-1b3f-49bf-8f67-6a497827f190 301!

View File

@ -2,7 +2,6 @@
<html>
<head>
<title>CSMS Claims and Neighbors</title>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CC1B9CQ691"></script>
<script>
window.dataLayer = window.dataLayer || [];
@ -10,19 +9,23 @@
gtag('js', new Date());
gtag('config', 'G-CC1B9CQ691');
</script>
<!-- Google Maps API with async loading -->
<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_ACTUAL_API_KEY&libraries=places,visualization,geometry,search"></script>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin: 0;
padding: 0;
}
iframe {
border: none;
width: 800px;
height: 600px;
margin: 20px auto;
display: block;
}
.button {
display: inline-block;
margin: 10px;
margin: 10px 20px;
padding: 10px 20px;
font-size: 16px;
color: white;
@ -30,10 +33,17 @@
border: none;
border-radius: 5px;
text-decoration: none;
cursor: pointer;
}
.button:hover {
background-color: #0056b3;
}
#button-container {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
#consent-banner {
position: fixed;
bottom: 0;
@ -45,6 +55,19 @@
display: none;
}
</style>
</head>
<body>
<h1>CSMS Claims and Neighbors</h1>
<iframe src="/redirect/google-maps"></iframe>
<iframe src="/redirect/gaia-gps"></iframe>
<div id="button-container">
<a href="#" class="button" id="google-maps-link">View in Google Maps</a>
<a href="#" class="button" id="gaia-gps-link">View in Gaia GPS</a>
</div>
<div id="consent-banner">
This site uses cookies to improve your experience. By continuing to browse, you accept the use of cookies.
<button onclick="acceptConsent()">Accept</button>
</div>
<script>
function generateToken(length) {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
@ -61,27 +84,29 @@
}
document.getElementById('gaia-gps-link').addEventListener('click', function(event) {
event.preventDefault();
const token = generateToken(16);
localStorage.setItem('gaiaAccessToken', token);
const url = 'gaia-landing.html?token=' + token + '&utm_source=website&utm_medium=button&utm_campaign=map_redirect';
const url = `/redirect/gaia-gps?token=${token}`;
gtag('event', 'click', {
'event_category': 'Outbound Link',
'event_label': 'Gaia GPS',
'value': url
});
this.href = url;
window.location.href = url;
});
document.getElementById('google-maps-link').addEventListener('click', function(event) {
event.preventDefault();
const token = generateToken(16);
localStorage.setItem('googleMapsAccessToken', token);
const url = 'google-maps-landing.html?token=' + token + '&utm_source=website&utm_medium=button&utm_campaign=map_redirect';
const url = `/redirect/google-maps?token=${token}`;
gtag('event', 'click', {
'event_category': 'Outbound Link',
'event_label': 'Google Maps',
'value': url
});
this.href = url;
window.location.href = url;
});
});
@ -90,16 +115,5 @@
document.getElementById('consent-banner').style.display = 'none';
}
</script>
</head>
<body>
<h1>CSMS Claims and Neighbors</h1>
<iframe src="https://www.google.com/maps/d/embed?mid=1uaJCMW64w_zwERr9nFcVJchrZdocNbA&ll=39.03966489533956%2C-105.32945964046155&z=14" width="800" height="600"></iframe>
<br>
<a href="#" target="_blank" class="button" id="google-maps-link">View in Google Maps</a>
<a href="#" target="_blank" class="button" id="gaia-gps-link">View in Gaia GPS</a>
<div id="consent-banner">
This site uses cookies to improve your experience. By continuing to browse, you accept the use of cookies.
<button onclick="acceptConsent()">Accept</button>
</div>
</body>
</html>