Top

Track Zip Code Searches as Events in Google Analytics

To track Zip Code searches as events in Google Analytics, follow these steps:

  1. Set up a Google Analytics Account.
  2. Copy your Tracking ID.

    Note: This will look like this: UA-XXXXXXXX-Y. If you prefer you can copy your custom tracking script. If you already have a Google Analytics account, you can get the tracking ID by navigating to Admin -> Tracking Info -> Tracking Code.

  3. Visit Mapply Account Page, log in if necessary.

    log in

  4. Select Display Settings.

    select display settings 

  5. Copy and paste your Tracking ID in the "Page Header HTML" section.

    copy and paste your tracking ID 

  6. Copy and paste this code 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>

    copy and paste this code 

  7. Select Save.

    select save

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