Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
GMShareSDK
Project
Project
Details
Activity
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
gengmeiios
GMShareSDK
Commits
a3f9d994
Commit
a3f9d994
authored
Apr 27, 2020
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
share 埋点增加获取 page_name 和 business_id 的时机
parent
63e9013a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
7 deletions
+27
-7
GMShareView.m
GMShareSDK/Classes/Share/GMShareView.m
+27
-7
No files found.
GMShareSDK/Classes/Share/GMShareView.m
View file @
a3f9d994
...
...
@@ -542,27 +542,47 @@ static NSString *shareCellIdentifier = @"shareCellIdentifier";
if
([
self
.
delegate
respondsToSelector
:
@selector
(
shareViewNeedBusinessId
)])
{
businessId
=
[
self
.
delegate
shareViewNeedBusinessId
];
}
NSDictionary
*
dic
=
@{
@"page_name"
:
SafeValue
(
phobosView
.
pageName
),
@"business_id"
:
SafeValue
(
businessId
),
@"url"
:
SafeValue
(
self
.
shareUrl
)};
if
(
!
[
businessId
isNonEmpty
])
{
// 配合使用主项目中的“synchronizePVData”可以同步埋点通用参数
businessId
=
self
.
businessId
;
}
NSString
*
pageName
=
SafeValue
(
phobosView
.
businessId
);
if
(
!
[
pageName
isNonEmpty
])
{
// 配合使用主项目中的“synchronizePVData”可以同步埋点通用参数
pageName
=
self
.
pageName
;
}
NSDictionary
*
dic
=
@{
@"page_name"
:
SafeString
(
pageName
),
@"business_id"
:
SafeString
(
businessId
),
@"url"
:
SafeString
(
self
.
shareUrl
)};
[
Phobos
track
:
@"page_click_share"
attributes
:
dic
];
}
}
// page_click_share_channel 埋点
-
(
void
)
phobosClickShareWithType
:
(
GMSharePlatform
)
type
{
// 这种方式过于死板,可能导致拿不到不如重构成
if
([
self
.
delegate
isKindOfClass
:[
UIResponder
class
]])
{
UIResponder
*
phobosView
=
(
UIResponder
*
)
self
.
delegate
;
NSString
*
businessId
=
SafeValue
(
phobosView
.
businessId
);
if
([
self
.
delegate
respondsToSelector
:
@selector
(
shareViewNeedBusinessId
)])
{
businessId
=
[
self
.
delegate
shareViewNeedBusinessId
];
}
if
(
!
[
businessId
isNonEmpty
])
{
// 配合使用主项目中的“synchronizePVData”可以同步埋点通用参数
businessId
=
self
.
businessId
;
}
NSString
*
pageName
=
SafeValue
(
phobosView
.
businessId
);
if
(
!
[
pageName
isNonEmpty
])
{
// 配合使用主项目中的“synchronizePVData”可以同步埋点通用参数
pageName
=
self
.
pageName
;
}
NSAssert
([
self
.
shareUrl
isNonEmpty
],
@"shareView.shareUrl 不应该为空"
);
NSDictionary
*
dic
=
@{
@"page_name"
:
Safe
Value
(
phobosView
.
pageName
),
@"business_id"
:
Safe
Value
(
businessId
),
@"url"
:
Safe
Value
(
self
.
shareUrl
),
NSDictionary
*
dic
=
@{
@"page_name"
:
Safe
String
(
pageName
),
@"business_id"
:
Safe
String
(
businessId
),
@"url"
:
Safe
String
(
self
.
shareUrl
),
@"share_channel"
:
[
self
channel
:
type
],
@"task_type"
:
Safe
Value
(
self
.
taskType
),
@"task_type"
:
Safe
String
(
self
.
taskType
),
@"business"
:
@"channel"
};
[
Phobos
track
:
@"page_click_share_channel"
attributes
:
dic
];
}
...
...
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