Search Box Click
This tracks when someone clicks / taps into the search box. For specifics on how to create variables, triggers, and tags, please look at the box Tracking Search Box Buttons above.
Variable: Use the existing variable:
Trigger: Create a new trigger with the following:
- Name: Name this whatever you would like. Recommendation: Search Box Click
- Trigger Type: Click - All Elements
- This trigger fires on: Some Clicks
- Find this trigger when an Event occurs and all of these conditions are true (select the following)
- Click Classes
- Contains
- [open box right of Contains]: Find the “class” element in the HTML of the search box. To do so, open a new browser tab/window and open the page with the search box you want to track. Click in the search box, right click and select Inspect, then for the “class” element
- Example:
- Class element in the example is “search-bar-input”
Tag: Create a new tag with the following:
- Name: Name this whatever you would like. Recommendation: Search Box Click
- Tag Type: Google Analytics: GA4 Event
- Configuration Tag: Google Analytics GA4 Configuration
- Event Name: Name this whatever you would like. Recommendation: search_box_click
- Triggering. Firing Triggers: Select the trigger made above
Search Box Tab
This tracks when someone clicks / taps a specific tab of a search box
Variable: Use the existing variable:
Trigger: Create a new trigger with the following:
- Name: Name this whatever you would like. Recommendation: Search Box [tab name] Tab
- Trigger Type: Click - All Elements
- This trigger fires on: Some Clicks
- Find this trigger when an Event occurs and all of these conditions are true (select the following)
- Click Classes
- equals
- [open box right of equals]: Find the URL of the search box tab. To find, right click on the search box tab, select Copy Link
Tag: Create a new tag with the following:
- Name: Name this whatever you would like. Recommendation: Search Box [tab name] Tab
- Tag Type: Google Analytics: GA4 Event
- Configuration Tag: Google Analytics GA4 Configuration
- Event Name: Name this whatever you would like. Recommendation: search_box_[name of tab]_tab
- Triggering. Firing Triggers: Select the trigger made above
Search Box Submission
This tracks when someone conducts a search from a search box
Variable: Use the existing variable:
Trigger: Create a new trigger with the following:
- Name: Name this whatever you would like. Recommendation: Search Box Submission
- Trigger Type: Form Submission
- This trigger fires on: Some Forms
- Find this trigger when an Event occurs and all of these conditions are true (select the following)
- Click URL
- contains
- [open box right of contains]: Find the “action” element in the HTML of the search form. To do so, open a new browser tab/window and open the page with the search box you want to track. Click in the search box, right click and select Inspect, then for the “action” element, which might be above or below the input line of code highlighted
- Example:
- Class element in the example is “https://goshen.on.worldcat.org/search”
Tag: Create a new tag with the following:
- Name: Name this whatever you would like. Recommendation: Search Box Submission
- Tag Type: Google Analytics: GA4 Event
- Configuration Tag: Google Analytics GA4 Configuration
- Event Name: Name this whatever you would like. Recommendation: search_box_submission
- Triggering. Firing Triggers: Select the trigger made above