Ready to make My City home?
Take your Next Step Today!

Faith-filled insight from our team

The My City Blog is designed to help readers reflect and find practical applications of shared talks and God’s word. We believe written words in the form of testimonials, how-to guides and recipes for success have the power to change lives. Come see our most recent blog posts today!
//GA Event Tracker Script. Licensed under MIT. Free for any use by all. Written by Paul Seal from // Get the category, action and label from the element and send it to GA. The action is optional, because mostly it will be a click event. var trackClickEvent = function () { var eventCategory = this.getAttribute("data-event-category"); var eventAction = this.getAttribute("data-event-action"); var eventLabel = this.getAttribute("data-event-label"); var eventValue = this.getAttribute("data-event-value"); ga('send', 'event', eventCategory, (eventAction != undefined && eventAction != '' ? eventAction : 'click'), eventLabel, eventValue); }; // Find all of the elements on the page which have the class 'ga-event' var elementsToTrack = document.getElementsByClassName("ga-event"); // Add an event listener to each of the elements you found var elementsToTrackLength = elementsToTrack.length; for (var i = 0; i < elementsToTrackLength; i++) { elementsToTrack[i].addEventListener('click', trackClickEvent, false); }