From a81d20bc18d002623fc24cdcea8df7eed6d85bc9 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 31 Aug 2020 19:59:58 +0200 Subject: pre-firebase setup... --- StoneIsland/GoogleService-Info.plist | 22 +++---- StoneIsland/google-services.json | 42 ------------- .../xcschemes/xcschememanagement.plist | 4 +- .../UserInterfaceState.xcuserstate | Bin 23606 -> 23438 bytes StoneIsland/www/js/index.js | 2 +- StoneIsland/www/js/lib/_router.js | 4 +- StoneIsland/www/js/lib/etc/analytics.js | 66 +++++++++++++-------- StoneIsland/www/js/lib/etc/push.js | 4 +- old-GoogleService-Info.plist | 40 +++++++++++++ old-google-services.json | 42 +++++++++++++ 10 files changed, 138 insertions(+), 88 deletions(-) delete mode 100644 StoneIsland/google-services.json create mode 100644 old-GoogleService-Info.plist create mode 100644 old-google-services.json diff --git a/StoneIsland/GoogleService-Info.plist b/StoneIsland/GoogleService-Info.plist index 0d23216d..fb4545dd 100644 --- a/StoneIsland/GoogleService-Info.plist +++ b/StoneIsland/GoogleService-Info.plist @@ -2,28 +2,24 @@ - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 CLIENT_ID - 426306878988-nuqlbd4k944sk5mm63vdubdptb3cpkmt.apps.googleusercontent.com + 862307359073-di238jkcuqfvbtslfllqd996nb5cjmfv.apps.googleusercontent.com REVERSED_CLIENT_ID - com.googleusercontent.apps.426306878988-nuqlbd4k944sk5mm63vdubdptb3cpkmt + com.googleusercontent.apps.862307359073-di238jkcuqfvbtslfllqd996nb5cjmfv API_KEY - AIzaSyAp9tJ_gK45ZhRDiaKOCgvsztQMbhsD_Ms + AIzaSyBl8CpcmBGZrz2M1ejNU_00jI3PTUJsv4M GCM_SENDER_ID - 426306878988 + 862307359073 PLIST_VERSION 1 BUNDLE_ID us.okfoc.stoneisland PROJECT_ID - stone-island + stone-island-app STORAGE_BUCKET - stone-island.appspot.com + stone-island-app.appspot.com IS_ADS_ENABLED - + IS_ANALYTICS_ENABLED IS_APPINVITE_ENABLED @@ -33,8 +29,8 @@ IS_SIGNIN_ENABLED GOOGLE_APP_ID - 1:426306878988:ios:0efb92963073829a + 1:862307359073:ios:67ce45d9c1687415b24d20 DATABASE_URL - https://stone-island.firebaseio.com + https://stone-island-app.firebaseio.com \ No newline at end of file diff --git a/StoneIsland/google-services.json b/StoneIsland/google-services.json deleted file mode 100644 index e638d477..00000000 --- a/StoneIsland/google-services.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "project_info": { - "project_number": "426306878988", - "firebase_url": "https://stone-island.firebaseio.com", - "project_id": "stone-island", - "storage_bucket": "stone-island.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:426306878988:android:0efb92963073829a", - "android_client_info": { - "package_name": "us.okfoc.stoneisland" - } - }, - "oauth_client": [ - { - "client_id": "426306878988-7348bgsps81ac05mvge1ir5smurn17h9.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyB1q4iF7-HOFm-6NOwqr7EkqfaDnc3Wimk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist index 4f3362e8..1020c69e 100644 --- a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -12,7 +12,7 @@ Cordova.xcscheme_^#shared#^_ orderHint - 4 + 3 CordovaLib.xcscheme @@ -22,7 +22,7 @@ CordovaLib.xcscheme_^#shared#^_ orderHint - 3 + 2 diff --git a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate index b441aa1a..c4eb822b 100644 Binary files a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate and b/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/StoneIsland/www/js/index.js b/StoneIsland/www/js/index.js index 9bc77c38..c8852f64 100755 --- a/StoneIsland/www/js/index.js +++ b/StoneIsland/www/js/index.js @@ -121,7 +121,7 @@ var app = (function(){ console.log("blog fetched, launching router") app.router.initial_route = window.deepLinkRoute || null if (app.router.initial_route) { - analytics.send('push/' + app.router.initial_route) + analytics.sendPageView('push/' + app.router.initial_route) } app.router.launch() }) diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js index 9feb262a..7d487689 100755 --- a/StoneIsland/www/js/lib/_router.js +++ b/StoneIsland/www/js/lib/_router.js @@ -101,7 +101,7 @@ var SiteRouter = Router.extend({ } // window.FirebasePlugin && window.FirebasePlugin.setScreenName(name) - analytics.send(name) + analytics.sendPageView(name) console.log("view >>", app.view) app.header.set_back( !! app.view.back ) app.view.show() @@ -129,7 +129,7 @@ var SiteRouter = Router.extend({ if (app.view && app.view.hide) { app.view.hide() } - analytics.send('store/' + code) + analytics.sendPageView('store/' + code) app.view = app.product app.header.set_back( true ) app.product.load(code) diff --git a/StoneIsland/www/js/lib/etc/analytics.js b/StoneIsland/www/js/lib/etc/analytics.js index 0d026f2f..2df8a04c 100644 --- a/StoneIsland/www/js/lib/etc/analytics.js +++ b/StoneIsland/www/js/lib/etc/analytics.js @@ -2,47 +2,61 @@ var analytics = (function() { var analytics = {} analytics.fields = { - trackingId: 'UA-XXXXXXXX-Y', + trackingId: 'G-24XNLKH9Z6', clientId: localStorage.getItem('ga:clientId'), storage: 'none', } analytics.init = function() { console.log("Analytics init") + if (window.FirebasePlugin) { + window.FirebasePlugin.setAnalyticsCollectionEnabled(true) + } analytics.build() - analytics.send('/') + analytics.sendPageView('/') } analytics.build = function() { - ;( function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','https://www.google-analytics.com/analytics.js','ga' ); + // ;( function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + // (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + // m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + // })(window,document,'script','https://www.google-analytics.com/analytics.js','ga' ); - analytics.ga = window.ga - analytics.ga('create', analytics.fields) - // prevent tasks that would abort tracking - analytics.ga('set', { - // don't abort if the protocol is not http(s) - checkProtocolTask: null, - // don't expect cookies to be enabled - checkStorageTask: null, - }) - // a callback function to get the clientId and store it ourselves - analytics.ga(function(tracker){ - localStorage.setItem('ga:clientId', tracker.get('clientId')); - }) + // analytics.ga = window.ga + // analytics.ga('create', analytics.fields) + // // prevent tasks that would abort tracking + // analytics.ga('set', { + // // don't abort if the protocol is not http(s) + // checkProtocolTask: null, + // // don't expect cookies to be enabled + // checkStorageTask: null, + // }) + // // a callback function to get the clientId and store it ourselves + // analytics.ga(function(tracker){ + // localStorage.setItem('ga:clientId', tracker.get('clientId')); + // }) + + // window.dataLayer = window.dataLayer || []; + // analytics.dataLayer = window.dataLayer + // analytics.gtag = () => { analytics.dataLayer.push(arguments) } + // analytics.gtag('js', new Date()) + // analytics.gtag('config', 'G-24XNLKH9Z6') } - analytics.send = function(path) { + analytics.sendPageView = function(path) { console.log("/a\\ send", path) - if (!analytics.ga) return - analytics.ga('send', { - // these are the three required properties, check GA's doc for the optional ones - hitType: 'screenview', - screenName: path, - appName: 'StoneIsland' + if (!analytics.gtag) return + FirebasePlugin.logEvent("select_content", { + content_type: "page_view", + item_id: path, }) + // FirebasePlugin.setScreenName(path) + // analytics.gtag('send', { + // // these are the three required properties, check GA's doc for the optional ones + // hitType: 'screenview', + // screenName: path, + // appName: 'StoneIsland' + // }) } return analytics diff --git a/StoneIsland/www/js/lib/etc/push.js b/StoneIsland/www/js/lib/etc/push.js index e09204d3..a744d5c9 100755 --- a/StoneIsland/www/js/lib/etc/push.js +++ b/StoneIsland/www/js/lib/etc/push.js @@ -141,11 +141,11 @@ var push = (function(){ } } else if (is_hub) { - analytics.send("push/open/hub") + analytics.sendPageView("push/open/hub") app.router.go("hub") } else { - analytics.send("push/open/store") + analytics.sendPageView("push/open/store") app.router.go("intro") } } diff --git a/old-GoogleService-Info.plist b/old-GoogleService-Info.plist new file mode 100644 index 00000000..0d23216d --- /dev/null +++ b/old-GoogleService-Info.plist @@ -0,0 +1,40 @@ + + + + + AD_UNIT_ID_FOR_BANNER_TEST + ca-app-pub-3940256099942544/2934735716 + AD_UNIT_ID_FOR_INTERSTITIAL_TEST + ca-app-pub-3940256099942544/4411468910 + CLIENT_ID + 426306878988-nuqlbd4k944sk5mm63vdubdptb3cpkmt.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.426306878988-nuqlbd4k944sk5mm63vdubdptb3cpkmt + API_KEY + AIzaSyAp9tJ_gK45ZhRDiaKOCgvsztQMbhsD_Ms + GCM_SENDER_ID + 426306878988 + PLIST_VERSION + 1 + BUNDLE_ID + us.okfoc.stoneisland + PROJECT_ID + stone-island + STORAGE_BUCKET + stone-island.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:426306878988:ios:0efb92963073829a + DATABASE_URL + https://stone-island.firebaseio.com + + \ No newline at end of file diff --git a/old-google-services.json b/old-google-services.json new file mode 100644 index 00000000..e638d477 --- /dev/null +++ b/old-google-services.json @@ -0,0 +1,42 @@ +{ + "project_info": { + "project_number": "426306878988", + "firebase_url": "https://stone-island.firebaseio.com", + "project_id": "stone-island", + "storage_bucket": "stone-island.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:426306878988:android:0efb92963073829a", + "android_client_info": { + "package_name": "us.okfoc.stoneisland" + } + }, + "oauth_client": [ + { + "client_id": "426306878988-7348bgsps81ac05mvge1ir5smurn17h9.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyB1q4iF7-HOFm-6NOwqr7EkqfaDnc3Wimk" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 1, + "other_platform_oauth_client": [] + }, + "ads_service": { + "status": 2 + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file -- cgit v1.2.3-70-g09d2