---
updatedAt: 2025-01-30T22:59:38.000Z
agentTools:
  projectIndex: https://docs.logrocket.com/v1.0/llms.txt
---

# Google Analytics

Integrating LogRocket with [Google Analytics](http://www.google.com/analytics/)

Add a LogRocket session URL to Google Analytics as a custom variable. Add this code anywhere in your app, after LogRocket and Google Analytics have been loaded.

```javascript
LogRocket.getSessionURL(function (sessionURL) {
  ga('send', {
    hitType: 'event',
    eventCategory: 'LogRocket',
    eventAction: sessionURL,
  });
});
```