move analytics to layout