/* Website: https://unfoldingApps.com Stream ID: 4767771125 Measurement ID: G-39HPWEM5K8 */ $.uaAnalytics = function() { this.getAccounts = function(pCbkFunc) { gapi.client.analyticsadmin.accounts.list({}). then(function(pResp) { pCbkFunc({ bError: false, acc: pResp.result.accounts }); }); }; this.create = function(pData, pCbkFunc) { gapi.client.analyticsadmin.properties.create({ parent: pData.idAccount, //"accounts/123456", // Replace with your Analytics Account ID property: { "displayName": pData.name, //"timeZone": "America/Los_Angeles", //"currencyCode": "USD", "industryCategory": "ARTS_AND_ENTERTAINMENT", "propertyType": "PROPERTY_TYPE_WEB", } }). then(function(response) { pCbkFunc({ bError: false, data: response.result.propertyId }); }). catch(function(pResp) { pCbkFunc({ bError: true }); }); /* gapi.client.analyticsadmin.properties.create({ resource: { displayName: pData.name, industryCategory: 'ARTS_AND_ENTERTAINMENT', // Change as needed timeZone: 'America/New_York', // Change as needed currencyCode: 'USD' // Change as needed } }). then(function(response) { pCbkFunc({ bError: false, idG4: response.result.propertyId }); }). catch(function(pResp) { pCbkFunc({ bError: true }); }); */ }; this.send = function(strPage_Name) { //console.log("Analytics: page="+strPage_Name); // gtag('event', strPage_Name, { 'send_to': 'G-39HPWEM5K8' }); }; return this; };//$.uaAnalytics = function()