Tracking workspace activities with Google Analytics GA4

Overview

Razuna includes built-in Google Analytics 4 (GA4) tracking to help you understand how your workspace is being used. This feature is optional and only active when you configure your GA4 credentials for a workspace.

Features

  • Server-side tracking - All events are sent directly from the Razuna server to Google Analytics, ensuring accurate tracking regardless of client-side blockers
  • Privacy-focused - Only workspace owners can enable tracking, and it respects your data governance policies
  • Workspace-specific - Each workspace can have its own GA4 property, or tracking can be disabled entirely
  • Comprehensive event tracking - Tracks file operations, folder management, searches, and CDN downloads

What Gets Tracked

File Operations

  • file_upload - When files are uploaded to the workspace
  • file_update - When file metadata is updated
  • file_delete - When files are moved to trash
  • file_download - When files are downloaded via CDN (CloudFront, Fastly, Cloudflare, Caddy, BunnyCDN)
  • file_show - When files are viewed/previewed
  • file_click - When files are clicked in the interface

Folder Operations

  • folder_create - When new folders are created
  • folder_update - When folders are renamed or modified
  • folder_delete - When folders are moved to trash

Search Operations

  • search - When users perform searches in the workspace
    • Includes search query and number of results found

Workspace Operations

  • workspace_update - When workspace settings are modified

Collection Operations

  • collection_create - When new collections are created
  • collection_update - When collections are modified

Event Data Parameters

Each tracked event includes the following parameters when available:

Parameter Description Example
workspace_id Unique identifier for the workspace 507f1f77bcf86cd799439011
file_id Unique identifier for the file (when applicable) 507f191e810c19729de860ea
folder_id Unique identifier for the folder (when applicable) 507f1f77bcf86cd799439012
message Description of the action quarterly-report.pdf
browser User's browser Chrome, Firefox, Safari
os User's operating system macOS, Windows, Linux
country User's country (from IP geolocation) United States, Germany
city User's city (from IP geolocation) San Francisco, Berlin
cdn_provider CDN provider for downloads cloudflare, fastly, bunny
found Number of search results (for search events) 42

Privacy & Compliance

What We Track

  • User actions - File uploads, downloads, searches, etc.
  • Geographic location - Approximate location based on IP address (country, city)
  • Browser/device information - Browser type, operating system
  • Timestamps - When actions occurred

What We Don't Track

  • Personal identifying information - No names, email addresses, or phone numbers
  • File contents - Only file names and metadata
  • User passwords - Never tracked under any circumstance
  • Payment information - Not sent to GA4

Data Ownership

  • You own your GA4 property and all data sent to it
  • Razuna does not have access to your GA4 data
  • You control data retention policies in your GA4 property
  • You can disable tracking at any time by removing your GA4 credentials

Setup Instructions

Step 1: Create a GA4 Property

  1. Go to Google Analytics
  2. Create a new GA4 property (or use an existing one)
  3. Navigate to AdminData Streams
  4. Select your web data stream (or create one)
  5. Note your Measurement ID (format: G-XXXXXXXXXX)

Step 2: Generate API Secret

  1. In your GA4 data stream settings, scroll to Measurement Protocol API secrets
  2. Click Create to generate a new API secret
  3. Give it a name like "Razuna Server"
  4. Copy the Secret value (you won't be able to see it again!)

Step 3: Configure Razuna

  1. Log in to your Razuna workspace
  2. Go to Workspace SettingsNotifications
  3. Scroll to the Google Analytics section
  4. Enter your Measurement ID (e.g., G-ABC123XYZ)
  5. Enter your API Secret
  6. Click Update
Important: Both fields must be filled, or both must be empty. You cannot save one without the other.

Step 4: Verify Tracking

  1. Perform some actions in your workspace (upload a file, create a folder, search)
  2. Go to your GA4 property → ReportsRealtime
  3. You should see events appearing within a few seconds

Viewing Your Analytics

Realtime Reports

  • GA4 → Realtime - See activity happening right now
  • Useful for verifying that tracking is working

Event Reports

  • GA4 → Reports → Engagement → Events - View all tracked events
  • Filter by event name to see specific actions (e.g., file_upload, search_search)

Exploration Reports

Create custom reports to analyze:

  • Most downloaded files
  • Search patterns and popular queries
  • User activity by geographic location
  • Peak usage times
  • Browser/device distribution

Custom Dimensions (Optional)

You can create custom dimensions in GA4 to analyze:

  • workspace_id - Compare activity across workspaces
  • folder_id - Identify most active folders
  • cdn_provider - Analyze CDN performance
  • browser - Understand user browser preferences
  • country - Geographic distribution of users

Troubleshooting

Events Not Appearing in GA4

Check Configuration:

  1. Verify both Measurement ID and API Secret are correct
  2. Ensure you're looking at the correct GA4 property
  3. Check that your API Secret hasn't expired

Check Server Logs:

  • Server-side tracking errors are logged but don't affect application functionality
  • Contact your system administrator if you suspect tracking issues

Verify in Realtime:

  • Perform a test action (upload a file)
  • Check GA4 Realtime report within 30 seconds
  • Events should appear almost immediately

Only Seeing Some Events

  • Tracking requires valid workspace configuration
  • Events are only tracked when both GA4 credentials are configured
  • Check that tracking wasn't recently disabled and re-enabled (cache may need time to refresh)

Wrong Data Appearing

  • Ensure you're viewing the correct date range in GA4
  • Verify you're looking at the correct GA4 property
  • Check that multiple workspaces aren't sharing the same GA4 property (this is allowed but may be confusing)

Performance Impact

Minimal Application Impact

  • All tracking is asynchronous and non-blocking
  • Failed GA4 requests never affect application functionality
  • 3-second timeout ensures tracking doesn't delay operations

Caching

  • Workspace GA4 credentials are cached for performance
  • Cache automatically updates when credentials are changed
  • No additional database queries for each tracked event

Network Usage

  • Each event sends approximately 1-2 KB to Google Analytics
  • Events are sent individually, not batched
  • No impact on end-user bandwidth (server-side only)

Best Practices

Separate Properties for Environments

  • Use different GA4 properties for production vs. staging
  • This prevents test data from polluting production analytics

Regular Monitoring

  • Review your analytics weekly to understand usage patterns
  • Set up alerts in GA4 for unusual activity

Data Retention

  • Configure data retention settings in GA4 according to your needs
  • Default is 2 months, maximum is 14 months

Privacy Compliance

  • Ensure your GA4 setup complies with GDPR, CCPA, and other regulations
  • Update your privacy policy to mention analytics tracking
  • Consider enabling Google Analytics' data deletion features

Disabling Tracking

To disable GA4 tracking for a workspace:

  1. Go to Workspace SettingsNotifications
  2. Scroll to the Google Analytics section
  3. Clear both the Measurement ID and API Secret fields
  4. Click Update

Tracking will stop immediately, and no further events will be sent to GA4.

Advanced Configuration

Multiple Workspaces, One Property

  • You can use the same GA4 property for multiple workspaces
  • Filter by workspace_id parameter to separate data in reports

Multiple Properties per Workspace

  • Not supported - each workspace can only have one GA4 property configured
  • Use GA4's data export features if you need to send data to multiple destinations

Custom Event Parameters

  • All available event parameters are automatically included
  • Additional parameters cannot be added without code changes

Support

For questions about:

  • GA4 setup and configuration - Consult Google Analytics documentation
  • Razuna-specific tracking issues - Contact your Razuna administrator
  • Feature requests - Submit via your normal support channels

Version History

  • v1.0 (November 2025) - Initial GA4 tracking implementation
    • Server-side tracking via Measurement Protocol
    • File, folder, search, and CDN download tracking
    • Workspace-level configuration
    • Automatic caching for performance

FAQ

Q: Is GA4 tracking required?
A: No, it's completely optional. If you don't configure GA4 credentials, no tracking occurs.
Q: Can users opt out of tracking?
A: Individual users cannot opt out. The workspace owner controls whether tracking is enabled for the entire workspace.
Q: Does this affect my Google Analytics quota?
A: GA4 has very generous free tier limits (10 million events per month). Normal Razuna usage is unlikely to exceed this.
Q: Can I track across multiple domains?
A: Yes, if you have multiple Razuna instances, you can use the same GA4 property for all of them. Use the workspace_id parameter to separate data.
Q: What happens if my API Secret expires?
A: GA4 API Secrets don't expire unless you delete them. If deleted, tracking will stop working until you generate a new secret.
Q: Can I see individual user activity?
A: No, for privacy reasons we don't send personally identifiable information to GA4. You can only see aggregate patterns and anonymous user behavior.
Q: Does this work with GA4's IP anonymization?
A: Since tracking is server-side, GA4 sees Razuna's server IP, not end-user IPs. However, we send geographic data (country, city) based on end-user IPs for location reporting.
Q: Can I export this data?
A: Yes, GA4 supports data export to BigQuery and other tools. This is configured in your GA4 property settings.
Help us improve our documentation. Did this article help?
Last updated on Nov. 4th, 2025
Still need help?Contact us
 
What can we do for you?
Found an issue or need an answer? Let us know here. We'll be happy to reply.