Create a gist now

Instantly share code, notes, and snippets.

@TheBecky /myindex.html Secret
Last active Aug 29, 2015

Embed
What would you like to do?
<!DOCTYPE html>
<html>
<head>
<title>Home Questionaire</title>
<!--Placeholder for Google Analytics Snippet -->
<!--Placeholder for MixPanel Snippet -->
<!--Placeholder for KissMetrics Snippet -->
<script type="text/javascript">
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1";
analytics.load("dNh6DitJgCCNU7NDQ14Y5zEscAoVO");
analytics.page(document.title)
}}();
</script>
<!--Placeholder for index.css link -->
</head>
<body>
<br>
<h1>What is your favorite place to travel?</h1>
<p>I am building a directory of the sweetest travel destinations.</p>
<br><br>
<form name="travel" onsubmit="identify(event)">
What is your favorite travel destination?
<br><br>
<input name="destination" required="" size="81" type="text"/>
<br><br><br>
Any reccomendations (cool things to do, places to visit or restaurants to eat)?
<br><br>
<textarea cols="81" name="details" required="" rows="10"></textarea>
<br><br>
Name:
<input name="fullname" required="" size="75" type="text"/>
<br><br>
Email:
<input name="email" required="" size="75" type="email"/>
<br><br><br>
<input name="submit" type="submit" value="submit"/>
<br><br>
</form>
<script type="text/javascript">
function identify(e){
e.preventDefault();
var form = e.target;
var email = form["email"].value;
var fullname = form["fullname"].value;
var destination = form["destination"];
var details = form["details"].value;
var user = {email: email, name: fullname, destination: destination, details: details};
analytics.identify(email, {email: email, name: fullname});
analytics.track('destination submitted', user, function() {
window.location.href = "";
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment