Top

Track ZIP Code Searches as Events in Google Analytics

1) Put your standard GA tracking code <script> in the Mapply Page Header HTML section (under Display Settings). This is an iFrame so it will also need to be here, even if you already have it included in your main page HTML. 

2) Put this code snippet in the Page Footer HTML section:

<script>
jQuery(function () {
jQuery('.btn-inverse').click(function(){
var zip = jQuery('#address_search').val();
ga('send', {
hitType: 'event',
eventCategory: 'Locator',
eventAction: 'ZIP-Search',
eventLabel: zip
});
});
});
</script>

This will create a new event every time someone searches with the Locator. The Action will be 'ZIP-Search', and the Label will be the actual Zip code.

 

Have more questions? Submit a request