Skip to content

Instantly share code, notes, and snippets.

@codecandies
Last active December 21, 2015 21:19
Show Gist options
  • Save codecandies/6367857 to your computer and use it in GitHub Desktop.
Save codecandies/6367857 to your computer and use it in GitHub Desktop.
click event counting example
button.onclick = function() {
// ga tracking, same on both sites
if( window._gaq !== undefined ) {
_gaq.push(['_trackEvent', 'liveblogs', 'reload', window.location.href]);
}
// mobile ivw counting?
if( typeof iom !== 'undefined' && typeof iam_data !== 'undefined' ) {
// IVW Version 2.0
iom.c(iam_data,1);
// cms click counter
var ccimg = document.createElement( 'img' );
ccimg.src = 'http://cc.zeit.de/cc.gif?banner-channel=' + iam_data.cp + '&r=' + escape( document.referrer ) + '&rand=' + Math.random()*10000000000000000;
}
// should be desktop (over accurate)
else if ( typeof ZEIT !== 'undefined' ) {
ZEIT.clickIVW( true );
}
};
@antiwarhol
Copy link

Bitte alternative Übertragung wählen, Ajax-Problem bei default mode. Zeile 9:

iom.c(iam_data,1);

(vgl. https://www.infonline.de/downloads/9-1356-748/INFOnline_SZM-Tag_2.0_MEW.pdf )

@codecandies
Copy link
Author

Soeben angepasst. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment