Track ZIP Code Searches as Events in Google Analytics

To track ZIP Code searches as events in Google Analytics, please 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:

    jQuery(function () { 
    var zip = jQuery('#address_search').val(); 
    ga('send', { 
    hitType: 'event', 
    eventCategory: 'Locator', 
    eventAction: 'ZIP-Search', 
    eventLabel: zip 

    copy and paste this code

  7. 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.

    select save

That's it!

Next Steps:

Was this article helpful?
0 out of 0 found this helpful