How can I echo a views object ($data->nid) into javascript? I need to echo out a few different variables in an onclick event for Google analytics.

I figured this would work but the specific $data objects aren't echoing out.  The variable_get does, however.

&lt;?php
  echo "&lt;script&gt;jQuery(document).ready(function($) {  
 _gaq.push([ '_trackEvent', 'my_category', 'my_action', '". variable_get('4_measly_letters', 'AAAA') ."|".$data-&gt;nid ."|".$data-&gt;node_data_field_i."']); 
  }); 
 &lt;/script&gt;";
?&gt;
If I understand well your case, you can test if $data indeed is loading your desired data. you can do this with &lt;?php print_r($data); ?&gt; (or if you use Devel module, is best use &lt;?php dsm($data); ?&gt;). if you see the list of values, you also will see the respective keys's names of each value.

If you do not see values, you can load the respective node informatation with $data = &lt;?php node_load($IdNode) ?&gt; where $IdNode is the ID of your node. Remember &lt;?php dsm($data); ?&gt; to see the data of your node.