var setAnalytics = {}; setAnalytics.getCookie = function(){ return 'a419b969337798f861f28938e72515e3'; } setAnalytics.getIP = function(){ return '54.161.108.58'; } setAnalytics.getHOST = function(){ return 'ec2-54-161-108-58.compute-1.amazonaws.com'; } setAnalytics.getAccessTime = function(){ return '2018/04/21 12:28:59'; } 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);