# Using the CloudWatch RUM Web Client with React 17 ## Add the snippet to index.html To install the web client in a React application, add the snippet inside the \
tag of `index.html`. ```html ... ... ``` ## Instrument Routing to Record Page Views If your application contains arguments in the URL's path, you likely want to record custom page IDs so that the arguments can be removed and the pages will be properly aggregated in CloudWatch. For example, if we have two URLs `https://amazonaws.com/user/123` and `https://amazonaws.com/user/456`, we likely want to remove the user ID from the path so that the page ID is `/user` for both URLs. For React applications, we can use a [React Router hook](https://reactrouter.com/web/api/Hooks/uselocation) to record a custom page ID: ```typescript import { useLocation } from "react-router-dom"; declare function cwr(operation: string, payload: any): void; const Container = () => { let location = useLocation(); React.useEffect(() => { console.log(location.pathname); cwr("recordPageView", location.pathname); }, [location]); return (