Search code examples
google-analyticsdrupal-7

How do I access the shared google analytics id in Drupal 7


I am looking to use the Drupal Google analyics tracking Id in another part of Drupal to do some custom tracking.

I want to use the shared ga uA code that has been entered by the user and not create a new one. How do I get a programmatic reference to the GA id that the user has already entered into the GA module.


Solution

  • Try this:

    $ga_id = variable_get('googleanalytics_account');