Skip to main content

Script

Learn how to add and configure the Oppla tracking script in your application.

Installation

Basic Installation

Add the Oppla tracking script to your website’s <head> section:

Async Loading

For better performance, load the script asynchronously:

Configuration

Basic Configuration

Configure basic tracking settings:

Advanced Configuration

Add advanced tracking options:

Event Tracking

Track Events

Track events using the script:

User Identification

Identify users:

Data Attributes

Track Events with Data Attributes

Add data attributes to your HTML elements:

Best Practices

  1. Load Early: Add the script as early as possible in the <head>
  2. Use Async: Load the script asynchronously for better performance
  3. Configure Properly: Set up tracking options based on your needs
  4. Test Thoroughly: Verify tracking in development environment

Common Issues

Script Not Loading

  • Check network connectivity
  • Verify script URL is correct
  • Check for JavaScript errors
  • Ensure proper script placement

Events Not Tracking

  • Verify initialization
  • Check event names and properties
  • Ensure proper timing of script loading
  • Check for console errors

Next Steps

Track Events

Learn about event tracking

Data Tags

Organize your tracking data