AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
3.2K members online now
3.2K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Universal Analytics not working with Google Site Search implementation.

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi All,

 

Recently started using CSE engine and implemented the same on my website with the following code:

 

<script>  (function() {
    var cx = 'XXXXXX:XXXXX';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src='https://cse.google.com/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();</script>
<gcse:search></gcse:search>

Now, wanted to have a detailed queries report and implemented the Universal Analytics code as below:
<script>  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXXXXXX-X', 'auto');
  ga('send', 'pageview');</script>

Waited for weeks but I do not see any GA data on the GA control panel.
Can someone, please guide me with this. It would be very appreciative if someone guide me with this.
Eagerly awaiting response.
Thanks in Advance.
Regards
Rafique.





Re: Universal Analytics not working with Google Site Search implementation.

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭
Hi,

Anybody please help me with this.

Thanks

Re: Universal Analytics not working with Google Site Search implementation.

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Got it working:

Added the below script just below the UA script and things started working:
&lt;script&gt;
_gaq = {};
_gaq.push = function() {
ga('send', 'pageview', arguments[0][1]);
};
&lt;/script&gt;

Thanks