Skip to content

Instantly share code, notes, and snippets.

@domsammut
domsammut / google-analytics-not-loaded-hitcallback.js
Last active December 19, 2015 20:59
A solution for when hitCallback functions do not receive a response using Google Analytics (analytics.js) http://dsam.co/WQJUtY
var url = "http://dsam.co/WQJUtY";
/*
* Simply checks that the loaded property exists
* and that it has a value of true.
*/
if (ga.hasOwnProperty('loaded') && ga.loaded === true) {
//Success, ga is loaded
ga('send', 'event', {
@domsammut
domsammut / index.html
Last active December 11, 2015 13:08
A CodePen by Dom Sammut. Simple CSS Loading animation - I just wanted to create a loading animation for a web app using CSS. Nothing to fancy.
<div class="loading-container">
<div class="loading"></div>
<div id="loading-text">loading</div>
</div>