Load the gapi script on the layout page, because it is loading out of order on the analytics page.