Navigation
Select a link below to jump to that section:
Overview
Michigan State University implemented a campus wide Search Tool to assist with standardizing the masthead and footer for all websites. The web results are powered by the Google Programmable Search Engine, which relies on Search Engine Optimization (SEO) best practices.
MSU Site owners can evaluate the Search Tool Hosted Solution and determine if the results work well for their sites. Web administrators who choose not to use this Search Tool are required to utilize the search box style as referenced in the brand standards. Sites that do not use the hosted search solution, should add a link to u.search.msu.edu to "Search all MSU" within their search result page.
For a live demo, The Hosted Page Solution can be previewed at: admissions.msu.edu and comms.msu.edu. Search tool results can be managed via Google Search Console.
The MSU Search Tool is ideal for users who:
- Currently have no search box on their site
- Would like to migrate to a newer search solution
- Collect search analytics
- Utilize the MSU Framework (Sitecore and Cascade)
Back to Top
Limitations:
- The search can only crawl a single domain
- All subdomains are searched if primary hostname is selected.
- For example, if sitesearch = “Archives.msu.edu”; search will also crawl “civilwar.archives.msu.edu”. If sitesearch = “civilwar.archives.msu.edu”; search will only display results for “civilwar.archives.msu.edu”
- The search will only crawl msu.edu domain and approved .com sites (such as whartoncenter.com)
- Customization of the search results is not available
- The query results will redirect visitors to a separate site, u.search.msu.edu
Back to Top
Technical Implementation – How to
The Search Tool uses basic HTML “form attributes” to send queries from your page to the hosted search solution. There are four elements that can be filled in to assist the search tool: Action, Client, Sitename, and Analytics (optional).
Back to Top
Attribute details:
- action - The action attribute will specify where to send the form-data when a form is submitted. Action must equal “//u.search.msu.edu/index.php”
- client - The client value will specify the name of your site. This value will carry over into the tab and header value in the results page.
- Example: “MSU Admissions”
- sitename - The sitename value will indicate what host to crawl for local results. Do not include “http://” or “https://”
- Example: “admissions.msu.edu”
- analytics (optional) - The analytics value will link events data to your specified Google Analytics account number. Google Universal Analytics version 3 (GA3) and version 4 (GA4) are supported. Universal Analytics will stop collecting data on July 1st, 2023.
- GA4 Example: “G-ABCD123456”
- GA3 Example: “UA-12345678-1”
- ga3 (optional) - Use this only if you collect results for both GA3 and GA4 concurrently.
Back to Top
Code Template:
Use the following code as a template for your Search box:
<div id="search-tool-box">
<!-- u.search.msu.edu BEGIN - fill in the form values -->
<!-- action must be equal to "//u.search.msu.edu/index.php" when using Search -->
<form action="//u.search.msu.edu/index.php " method="get">
<!-- value should be equal to site name. Ex: Admissions -->
<input type="hidden" name="client" value="" />
<!-- value should be equal to the hostname that will be searched. Ex: "admissions.msu.edu"-->
<input type="hidden" name="sitesearch" value="" />
<!-- OPTIONAL - value should be equal to your Google v4 analytics number G-####### -->
<input type="hidden" name="analytics" value="" />
<!-- u.search.msu.edu END -->
<label class="hide" for="q">Search Tool</label>
<input id="q" name="q" placeholder="Search… " />
<input id="btn_search" type="submit" value="search button" />
</form>
</div>
Back to Top
Where to find GA4 Measurement ID (G-######)
- Admin | Property | Data Stream
- Click available stream. “Measurement ID” is in the upper right; Example: “G-ABCD12345”.
Back to Top
Support for GA3 and GA4
An additional attribute has been added to support both GA3 and GA4 reports. This requires adding the attribute “ga3”. Google does not provide a method to port your events from v3 to v4. For example:
<!-- OPTIONAL - value should be equal to your Google v4 analytics number G-####### -->
<input type="hidden" name="analytics" value="" />
<!-- OPTIONAL - value should be equal to your Google v3 analytics number UA-####### -->
<input type="hidden" name="ga3" value="" />
Back to Top
How to view GA4 analytics data
GA4 only shows your event parameters for events in the last 30 minutes using the “Realtime” tab in the Reports section. To track parameters, you will have to create a custom dimension for that event.
The MSU Search Tool will send the event action: search_tool_query. This event action has two parameters, search_tool_label and search_tool_category. Label is the search query, and category is the domain.
The following are the steps to make a custom dimension
- Navigate to Admin | Custom definitions | Create custom dimension.
- Fill out a parameter, description, and the name of the event parameter. The Event Parameter is search_tool_label. Name and Description can be labeled to your preference. Example:
- Dimension name -> Search Tool Query
- Scope -> Event
- Description -> Results from search tool
- Event Parameter -> search_tool_label
- Optional: Repeat #2 for search_tool_category to record the sitesearch (domain) value.
Back to Top
View the results
You can use the Real-time section to see events that occurred within the last 30 minutes.
For longer term, use Engagement -> Events section. Recent events will not be displayed; they will need 24-48 hours. Click on search_tool_query, for insight into your data.
Back to Top