← Back to API
Set Google Analytics ID
olark.configure('system.google_analytics_id', string );
Notes
Set the Google Analytics ID for your account on a specific page.
For example, you might have separate domains using the same Olark account, but different Google Analytics IDs.
<?php
// Get the current domain
$host = $_SERVER['HTTP_HOST'];
if ($host == "example.com") {
olark.configure('system.google_analytics_id', 'YOUR-GA-ID' );
}
elseif ($host == "test.org") {
olark.configure('system.google_analytics_id', 'OTHER-GA-ID' );
}
?>
Check out our related help guide for this here. You can also view advanced troubleshooting help for Google Analytics + Olark here.