var setAnalytics = {}; setAnalytics.getCookie = function(){ return 'ce6edaa9cd0c1d5ebab0e515f4f3c956'; } setAnalytics.getIP = function(){ return '54.166.188.64'; } setAnalytics.getHOST = function(){ return 'ec2-54-166-188-64.compute-1.amazonaws.com'; } setAnalytics.getAccessTime = function(){ return '2017/11/22 16:10:46'; } setAnalytics.getPageID = function(){ return ''; } setAnalytics.getPageCode = function(){ return ''; } setAnalytics.data = { "setCookie" : setAnalytics.getCookie(), "setIP" : setAnalytics.getIP(), "setAccessTime" : setAnalytics.getAccessTime(), "setPageID" : setAnalytics.getPageID(), "setPageCODE" : setAnalytics.getPageCode(), "setHOST" : setAnalytics.getHOST(), "event" : "setAnalytics_event" } dataLayer.push(setAnalytics.data);