How do I modify the _trackPageview output of the Google Analytics Drupal 7 module? I am working with the Google Analytics (googleanalytics) module in Drupal 7 and I need to get search categories added to the code. The module itself doesn't seem to offer any hooks in for an operation like this. I am considering trying to go into the storage of drupal_add_js to modify it. But I don't like how hacky that is.

So my next thought is to modify the module. But I would rather not do this to a contrib module. So any thoughts? I have been also wondering if I can push _trackPageview twice to Google on the same page, with the second time being with the search query and category. But I don't know how Google Analytics will work with that option.
If your question is "how to pass custom values to Google Analytics ?", then why wouldn't you use the Custom Variables feature of Google Analytics, populated by custom tokens ?


Create custom token containing search categories (via hook_token_info() and hook_tokens()) 
In Google Analytics Module interface, in the "Custom Variables" fieldset, add your custom token