Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
da896e50
Commit
da896e50
authored
Nov 30, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据统计紧急需求开发
parent
640c14bd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+1
-0
YHLoginManager.swift
...axy/Classes/Modules/Login(登录)/Server/YHLoginManager.swift
+2
-0
YHAnalytics.swift
galaxy/galaxy/Classes/Tools/Analytics/YHAnalytics.swift
+17
-0
No files found.
galaxy/galaxy/AppDelegate.swift
View file @
da896e50
...
...
@@ -48,6 +48,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
YHConfigManager
.
shared
.
loadConfigData
()
YHAnalytics
.
appInstall
()
//5.预加载
preloadOP
()
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/Server/YHLoginManager.swift
View file @
da896e50
...
...
@@ -55,6 +55,7 @@ extension YHLoginManager {
if
let
userModel
=
userModel
{
UserDefaults
.
standard
.
set
(
userModel
.
toDictionary
(),
forKey
:
YhConstant
.
KLoginedInfoKey
)
UserDefaults
.
standard
.
synchronize
()
YHAnalytics
.
login
(
userModel
.
id
??
""
)
}
}
...
...
@@ -64,6 +65,7 @@ extension YHLoginManager {
deviceTokenModel
.
registerId
=
""
UserDefaults
.
standard
.
set
(
nil
,
forKey
:
YhConstant
.
KLoginedInfoKey
)
UserDefaults
.
standard
.
synchronize
()
YHAnalytics
.
loginout
()
}
func
loadLocalUserInfoData
()
{
...
...
galaxy/galaxy/Classes/Tools/Analytics/YHAnalytics.swift
View file @
da896e50
...
...
@@ -44,6 +44,11 @@ class YHAnalytics {
options
.
autoTrackEventType
=
[
.
eventTypeAppStart
,
.
eventTypeAppEnd
,
.
eventTypeAppClick
,
.
eventTypeAppViewScreen
]
options
.
enableVisualizedAutoTrack
=
true
options
.
enableVisualizedProperties
=
true
options
.
enableTrackPageLeave
=
true
options
.
enableAutoTrackChildViewScreen
=
true
options
.
enableHeatMap
=
true
options
.
enableSaveDeepLinkInfo
=
true
//初始化SDK
SensorsAnalyticsSDK
.
start
(
configOptions
:
options
)
...
...
@@ -89,4 +94,16 @@ extension YHAnalytics {
static
func
timeEnd
(
_
event
:
String
,
properties
:
[
AnyHashable
:
Any
]?
=
[:])
{
SensorsAnalyticsSDK
.
sharedInstance
()?
.
trackTimerEnd
(
event
,
withProperties
:
properties
)
}
static
func
login
(
_
id
:
String
)
{
SensorsAnalyticsSDK
.
sharedInstance
()?
.
login
(
id
,
withProperties
:
[
"iOS"
:
UIDevice
.
appVersion
()])
}
static
func
loginout
()
{
SensorsAnalyticsSDK
.
sharedInstance
()?
.
logout
()
}
static
func
appInstall
()
{
SensorsAnalyticsSDK
.
sharedInstance
()?
.
trackAppInstall
()
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment