title: Google Analytics on React JS site outputting incorrect data (broken sessions?)
body: <p>We have a site with most of the content managed by Wordpress, however when the user navigates to search pages (user searches for a product), it's handled by React JS. </p>
  
  <p>It's all on the same domain, so the user never knows that they are interfacing with two different applications.</p>
  
  <p>Google Analytics on the site, however, doesn't seem to perceive sessions correctly. It's logging entrances (landing pages) to the site as search pages with rather long URLs:</p>
  
  <p><a href="https://i.stack.imgur.com/xsoNz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xsoNz.jpg" alt="landing pages"></a></p>
  
  <ul>
  <li>There are thousands of landing pages like this, and the site is new, so there's no way this is all traffic is coming in from external links</li>
  <li>Referrer path for all of these sessions is "(not set)"</li>
  <li>Internal IP addresses are filtered</li>
  <li>The traffic is coming from various sources/mediums, suggesting that sessions are somehow breaking (screenshot below)</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/ho5Kv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ho5Kv.jpg" alt="sources for landing pages"></a></p>
  
  <p>Currently, GA is set up with GTM. I tried <a href="https://github.com/holidaycheck/react-google-tag-manager" rel="nofollow noreferrer">using this</a> to fire the GTM tag in React.</p>
  
  <p>Also attempted making the GA tag within GTM fire on browser history changes rather than page views (history changes fire when in React, normal page views in Wordpress). But the issue still persists with these modifications. </p>
  
  <p><em>Note that these sessions are not specific to any one browser:</em>
  <a href="https://i.stack.imgur.com/Tj8tv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tj8tv.jpg" alt="landing pages by browser"></a></p>