When you load and invoke foundationExtendEBI.js
, the script will check if you use Google Analytics and, if so, provide deeper insight into link clicks and certain key combos.
These events will be sent as JS Events to your Google Analytics account.
Here's the abilities you get:
.track-with-analytics-events
: Manually tracked area + link name.masthead-black-bar
: Black bar + link name.masthead
: Masthead + link name.related ul
: Popular + link name.with-overlay
: Highlight box + link name#global-footer
: Footer + link name#global-search
: Global Search + link name#local-search
: Local search + link name.analytics-content-intro
and .intro-unit
: Intro + link name.analytics-content-sidebar
: Sidebar + link name.analytics-content-left
: Left content + link name.analytics-content-right
: Right content + link name.analytics-content-footer
: Content footer + link name.analytics-content-main
: Main content + link nameIf you're not seeing the events in your account:
.google-analytics-loaded
to your body
elementjQuery('body').addClass('verbose-analytics');
in your web console for debugging infoIf you'd like to extend the code, copy the code from ebiGaIndicateLoaded()
and add events in the fashion of:
jQuery("body.google-analytics-loaded .my-custom-area").on('mousedown', 'a, button', function(e) {
analyticsTrackInteraction(e.target,'Custom tracked area');
});
If you don't use Google Analytics and use a different solution (suchas Piwik) this method should be easy to adapt.