var setAnalytics = {}; setAnalytics.getCookie = function(){ return '0b78d20e31d65c97d5e420c1d17e7c6b'; } setAnalytics.getIP = function(){ return '23.20.7.34'; } setAnalytics.getHOST = function(){ return 'ec2-23-20-7-34.compute-1.amazonaws.com'; } setAnalytics.getAccessTime = function(){ return '2018/05/21 10:04:42'; } 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);