Skip to content

Commit

Permalink
fix with ga() for analytics.js
Browse files Browse the repository at this point in the history
add ga events for clicks and pageload
  • Loading branch information
VikramTiwari committed Aug 29, 2016
1 parent b643ca1 commit 496635f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions index.html
Expand Up @@ -58,7 +58,7 @@
<body>
<aside class="profile-card">
<header>
<a href="https://developers.google.com/experts/people/vikram-tiwari" target="_blank">
<a onclick="trackClick('profilepic')" href="https://developers.google.com/experts/people/vikram-tiwari" target="_blank">
<img src="./assets/vikram.jpg" alt="vikram profile pic" />
</a>
<h1>Vikram Tiwari</h1>
Expand All @@ -69,22 +69,22 @@ <h2>Hey Dreamer! Let's Create.</h2>
<i>"Vi Veri Veniversum Vivus Vici" - V</i>
</div>
<ul class="profile-social-links">
<li>
<li onclick="trackClick()">
<a href="https://www.facebook.com/vikram.tiwari.falcon" target="_blank">
<svg viewBox="0 0 32 32">
<path fill="#3b5998" d="M17.996 32h-5.996v-16h-4v-5.514l4-0.002-0.007-3.248c0-4.498 1.22-7.236 6.519-7.236h4.412v5.515h-2.757c-2.064 0-2.163 0.771-2.163 2.209l-0.008 2.76h4.959l-0.584 5.514-4.37 0.002-0.004 16z" />
</svg>
</a>
</li>
<li>
<li onclick="trackClick()">
<a href="https://twitter.com/vikram_tiwari" target="_blank">
<svg viewBox="0 0 32 32">
<path fill="#55ACEE" d="M32 6.076c-1.177 0.522-2.443 0.875-3.771 1.034 1.355-0.813 2.396-2.099 2.887-3.632-1.269 0.752-2.674 1.299-4.169 1.593-1.198-1.276-2.904-2.073-4.792-2.073-3.626 0-6.565 2.939-6.565 6.565 0 0.515 0.058 1.016 0.17 1.496-5.456-0.274-10.294-2.888-13.532-6.86-0.565 0.97-0.889 2.097-0.889 3.301 0 2.278 1.159 4.287 2.921 5.465-1.076-0.034-2.088-0.329-2.974-0.821-0.001 0.027-0.001 0.055-0.001 0.083 0 3.181 2.263 5.834 5.266 6.437-0.551 0.15-1.131 0.23-1.73 0.23-0.423 0-0.834-0.041-1.235-0.118 0.835 2.608 3.26 4.506 6.133 4.559-2.247 1.761-5.078 2.81-8.154 2.81-0.53 0-1.052-0.031-1.566-0.092 2.905 1.863 6.356 2.95 10.064 2.95 12.076 0 18.679-10.004 18.679-18.68 0-0.285-0.006-0.568-0.019-0.849 1.283-0.926 2.396-2.082 3.276-3.398z"
/>
</svg>
</a>
</li>
<li>
<li onclick="trackClick()">
<a href="https://github.com/vikramtiwari/" target="_blank">
<svg viewBox="0 0 32 32">
<path fill="#000" d="M16 0c-8.837 0-16 7.163-16 16s7.163 16 16 16 16-7.163 16-16-7.163-16-16-16zM25.502 25.502c-1.235 1.235-2.672 2.204-4.272 2.881-0.406 0.172-0.819 0.323-1.238 0.453v-2.398c0-1.26-0.432-2.188-1.297-2.781 0.542-0.052 1.039-0.125 1.492-0.219s0.932-0.229 1.438-0.406 0.958-0.388 1.359-0.633 0.786-0.563 1.156-0.953 0.68-0.833 0.93-1.328 0.448-1.089 0.594-1.781 0.219-1.456 0.219-2.289c0-1.615-0.526-2.99-1.578-4.125 0.479-1.25 0.427-2.609-0.156-4.078l-0.391-0.047c-0.271-0.031-0.758 0.083-1.461 0.344s-1.492 0.688-2.367 1.281c-1.24-0.344-2.526-0.516-3.859-0.516-1.344 0-2.625 0.172-3.844 0.516-0.552-0.375-1.075-0.685-1.57-0.93s-0.891-0.411-1.188-0.5-0.573-0.143-0.828-0.164-0.419-0.026-0.492-0.016-0.125 0.021-0.156 0.031c-0.583 1.479-0.635 2.839-0.156 4.078-1.052 1.135-1.578 2.51-1.578 4.125 0 0.833 0.073 1.596 0.219 2.289s0.344 1.286 0.594 1.781 0.56 0.938 0.93 1.328 0.755 0.708 1.156 0.953 0.854 0.456 1.359 0.633 0.984 0.313 1.438 0.406 0.95 0.167 1.492 0.219c-0.854 0.583-1.281 1.51-1.281 2.781v2.445c-0.472-0.14-0.937-0.306-1.394-0.5-1.6-0.677-3.037-1.646-4.272-2.881s-2.204-2.672-2.881-4.272c-0.7-1.655-1.055-3.414-1.055-5.23s0.355-3.575 1.055-5.23c0.677-1.6 1.646-3.037 2.881-4.272s2.672-2.204 4.272-2.881c1.655-0.7 3.415-1.055 5.23-1.055s3.575 0.355 5.23 1.055c1.6 0.677 3.037 1.646 4.272 2.881s2.204 2.672 2.881 4.272c0.7 1.655 1.055 3.415 1.055 5.23s-0.355 3.575-1.055 5.23c-0.677 1.6-1.646 3.037-2.881 4.272z"
Expand All @@ -95,5 +95,12 @@ <h2>Hey Dreamer! Let's Create.</h2>
</ul>
</aside>
</body>
<script type="text/javascript">
// events tracking with GA
// ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);
function trackClick() {
ga('send', 'event', 'button', 'click', event.target.href, 1);
}
</script>

</html>

0 comments on commit 496635f

Please sign in to comment.