var setAnalytics = {}; setAnalytics.getCookie = function(){ return 'd22f93417bcb44531bdb663f1a08c6e8'; } setAnalytics.getIP = function(){ return '54.156.39.245'; } setAnalytics.getAccessTime = function(){ return '2018/10/17 15:08:08'; } setAnalytics.data = { "setCookie" : setAnalytics.getCookie(), "setIP" : setAnalytics.getIP(), "setAccessTime" : setAnalytics.getAccessTime(), "event" : "setAnalytics_event" } dataLayer.push(setAnalytics.data);