Skip to main content

Analytics, Event Tracking, and Google Analytics Integration

Track store locator views, searches, and clicks, plus integrate with Google Analytics and other tracking tools.

StoreRocket tracks how visitors interact with your store locator out of the box. You can see what people are searching for, which locations get the most attention, and which websites are driving the most traffic to your widget.

Built-in analytics dashboard

Go to your Analytics page to see an overview of your widget's performance. Use the date picker at the top to look at specific time periods: 7 days, 30 days, 90 days, 12 months, This year, or Custom for your own dates. Each number also shows how it compares with the period right before it.

Here's what StoreRocket tracks:

Metric

What it means

Store locator views

How many times your store locator was loaded on a page

Searches

How many times a visitor searched for a location

Location clicks

Visitors opening locations or using directions, phone, email, website and call-to-action links

No results

Searches that found no location

Select a number to switch the chart under it to that metric. A map below shows where visitors searched from. To download the numbers, select Export CSV and choose Views, Searches, Location clicks or Leads for your selected dates. Views, Searches and Location clicks download summaries. Leads downloads individual enquiries.

StoreRocket records opening a location and clicks on its directions, phone, email, website and call-to-action links. One action is counted once.

Popular locations and websites

Open Analytics > Clicks to see which locations get the most clicks, with the types of action visitors used, including opens, directions, calls, emails, website visits and buttons. Select Group by > No grouping to see every single click.

Open Analytics > Views to see which pages of your website your widget is embedded on and how many views each page drives. Great for understanding demand across your network.

Search data

Open Analytics > Searches to see exactly what visitors are typing into the search box. Common patterns include city names, zip codes, and "near me" style searches. Each search shows the closest location it found, or that it found nothing.

Select Group by > Group: Term to see each term once, with its search count and how often it found nothing. In this view, Found nothing shows terms that failed at least once, and their totals include all searches for those terms. With No grouping, the same filter shows only individual searches that found nothing.

Exporting your analytics

Choose your dates, search and filters first. Exports include all matching table pages, not only the page you are viewing.

Views: Export report downloads one row per page, with its view total and last view in UTC. Open the arrow beside it and choose Individual views for every view, its date and full page address.

Searches: With Group: Term, Export report downloads one row per term, with its total searches, searches that found nothing and last search in UTC.

To export a summary of terms that found nothing, keep Group: Term, select the Found nothing filter, then choose Export report. Each total still includes all searches for that term, including searches that found a location. The Found nothing count shows only the failed searches.

With No grouping, Export searches downloads individual searches. Apply the Found nothing filter here for individual failed searches only. The arrow beside the export button offers the other format.

Clicks: Export report downloads one row per location, with total clicks, each action's count and the last click in UTC. The arrow's Individual clicks downloads one row per action. Calls to Action counts taps on your custom buttons, not completed calls or visits.

Choosing No grouping makes individual views or clicks the main export. The main export follows your table's sorting. Large Views and Searches reports state their coverage. Choose fewer days if you need every record in the summary.

Custom JavaScript events

StoreRocket fires custom JavaScript events on the page whenever visitors interact with your store locator. You can listen for these events and forward them to any analytics platform: Google Analytics 4, Google Tag Manager, Mixpanel, Segment, Plausible, or anything else.

Events available

Event name

When it fires

Data included

storerocket-storelocator-load

Widget loads on the page

None

storerocket-storelocator-search

Visitor performs a search

detail.query (search text)

storerocket-storelocator-click

Visitor clicks on a location

detail.location_id, detail.click_type

Which setup do you have?

Before adding the snippet, check how GA4 is installed on your site:

  • Standalone GA4 (you added the gtag.js snippet directly to your site): use the GA4 section below.

  • Google Tag Manager (you manage GA4 through a GTM container): use the GTM section below. This includes Shopify stores using Elevar, Analyzify, or similar apps.

Not sure? Open your browser console and type typeof gtag. If it says "function", you have standalone GA4. If it says "undefined", your GA4 likely runs through GTM.

Sending events to Google Analytics 4 (standalone)

This works when GA4 is installed directly on your page (not through GTM). Add this snippet after your GA4 tag:

<script>
document.addEventListener('storerocket-storelocator-load', function() {
gtag('event', 'storerocket_view');
});
document.addEventListener('storerocket-storelocator-search', function(e) {
gtag('event', 'storerocket_search', { search_term: e.detail.query });
});
document.addEventListener('storerocket-storelocator-click', function(e) {
gtag('event', 'storerocket_click', {
location_id: e.detail.location_id,
click_type: e.detail.click_type
});
});
</script>

Events will show up in GA4's Realtime report within seconds.

Important: If you see gtag is not defined in the console, your GA4 runs through GTM. Use the GTM section below instead.

Sending events to Google Tag Manager

If GA4 is managed through GTM, the gtag() function is not available on your page. You need to push events to the dataLayer and set up triggers in GTM. There are two steps.

Step 1: Add this snippet to your page (after the StoreRocket embed script):

<script>
window.dataLayer = window.dataLayer || [];
document.addEventListener('storerocket-storelocator-load', function() {
dataLayer.push({ event: 'storerocket_view' });
});
document.addEventListener('storerocket-storelocator-search', function(e) {
dataLayer.push({
event: 'storerocket_search',
search_term: e.detail.query
});
});
document.addEventListener('storerocket-storelocator-click', function(e) {
dataLayer.push({
event: 'storerocket_click',
location_id: e.detail.location_id,
click_type: e.detail.click_type
});
});
</script>

This pushes events into the dataLayer. On its own, this is not enough. You also need to tell GTM what to do with these events.

Step 2: Create triggers and tags in GTM.

  1. Go to your GTM container and create three Custom Event triggers (Triggers > New > Custom Event):

    • Event name: storerocket_view

    • Event name: storerocket_search

    • Event name: storerocket_click

  2. Create three Data Layer Variables (Variables > New > Data Layer Variable):

    • Variable name: search_term

    • Variable name: location_id

    • Variable name: click_type

  3. Create three GA4 Event tags (Tags > New > Google Analytics: GA4 Event):

    • Tag 1: Event Name = storerocket_view, Trigger = storerocket_view

    • Tag 2: Event Name = storerocket_search, Trigger = storerocket_search. Add event parameter: search_term = your search_term variable.

    • Tag 3: Event Name = storerocket_click, Trigger = storerocket_click. Add event parameters: location_id and click_type using your variables.

  4. Use GTM Preview mode to verify events fire when you interact with the store locator, then Publish.

Both steps are required. The snippet alone will not send events to GA4 without the GTM triggers.

UTM parameters

StoreRocket passes the UTM parameters from your page URL to the booking, call-to-action and website links inside the widget. See UTM Tracking & Marketing Attribution. Because GA4 also tracks the page URL including UTMs, your widget events are associated with whatever campaign brought the visitor to that page.

Troubleshooting

Analytics showing no data

Give it at least 24 hours. If you just installed the widget, there might not be enough data yet. Also verify your embed code is correctly installed. Open the preview in Store Locator > Customize to make sure everything loads.

Numbers seem low

Check the date range, make sure all pages have the correct embed code, and note that heavy website caching can affect view counts.

Custom events not showing in GA4

  1. Check if you're using GTM or standalone GA4. Open the browser console and type typeof gtag. If it says "undefined", you're on GTM and must use the GTM setup (dataLayer.push + triggers). The gtag() snippet will not work.

  2. Verify the events fire. Open the browser console and type document.addEventListener('storerocket-storelocator-load', function() { console.log('it works'); }) then reload. If you see "it works", the events are firing correctly.

  3. If using GTM: Make sure you completed both steps (snippet on the page AND triggers in GTM). The snippet alone does nothing without GTM triggers. Use GTM Preview mode to verify events appear in the debug panel.

  4. If using standalone GA4: Make sure the snippet is placed after your GA4 tag on the page. Check the console for gtag is not defined errors.

  5. Check GA4's Realtime report after searching for a location.

Questions? Message us on live chat.

Did this answer your question?