Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckFarm
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
LuckFarm
Commits
ba8ac267
Commit
ba8ac267
authored
Nov 13, 2020
by
zhangshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 统计
parent
0f746e60
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
30 deletions
+70
-30
AppDelegate.mm
GYDemo/GYDemo/AppDelegate.mm
+1
-1
IOSADManager.h
GYDemo/GYDemo/SCAds/IOSADManager.h
+3
-0
IOSADManager.m
GYDemo/GYDemo/SCAds/IOSADManager.m
+54
-18
GYAdsTrackModel.h
GYDemo/GYDemo/SCAds/model/GYAdsTrackModel.h
+1
-0
AddCSJADManager.m
GYDemo/GYDemo/SCAds/platform/AddCSJADManager.m
+3
-3
AddGDTADManager.m
GYDemo/GYDemo/SCAds/platform/AddGDTADManager.m
+3
-3
AddRuiShiADManager.m
GYDemo/GYDemo/SCAds/platform/AddRuiShiADManager.m
+3
-3
AddSigmobADManager.m
GYDemo/GYDemo/SCAds/platform/AddSigmobADManager.m
+2
-2
No files found.
GYDemo/GYDemo/AppDelegate.mm
View file @
ba8ac267
...
...
@@ -724,7 +724,7 @@ NSDictionary* appLaunchOpts;
[[CGUserManager shared] getServiceInfo:^{
NSString *status = [[CGUserManager shared].appSwitch[@"isopenH5"] stringValue];
NSLog(@"isopenH5 = %@", status);
if ([status isEqualToString:@"1"]) {
if (
!
[status isEqualToString:@"1"]) {
Data * data = [[Data alloc] init];
if([[data Read] objectForKey:@"refresh_token"] == nil) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(launchAdSuccesShow) name:LaunchAdSuccesShow object:nil];
...
...
GYDemo/GYDemo/SCAds/IOSADManager.h
View file @
ba8ac267
...
...
@@ -89,6 +89,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 点击事件统计
/// @param adModel 当前广告对象
-
(
void
)
videoAdDidClick
:(
GYAdsTrackModel
*
)
adModel
;
//------------------------------------- 以下下方法是不要主动调用可以 -----------------------------
...
...
GYDemo/GYDemo/SCAds/IOSADManager.m
View file @
ba8ac267
...
...
@@ -130,10 +130,21 @@ static IOSADManager * manager = nil;
if
(
AdType
==
ADType_Video
)
{
// 视频
if
(
self
.
videoModels
.
count
)
{
if
(
self
.
cachevideo
.
count
)
{
[
self
showAdWithData
:
self
.
cachevideo
.
firstObject
withADType
:
AdType
];
self
.
showNow
=
NO
;
GYAdsTrackModel
*
ADData
=
self
.
cachevideo
.
firstObject
;
NSTimeInterval
tiem
=
[
ADData
.
cacheDate
timeIntervalSinceNow
];
if
(
fabs
(
tiem
)
>
900
)
{
[
self
.
videoModels
removeAllObjects
];
[
self
.
cachevideo
removeAllObjects
];
[
self
showADType
:
AdType
resultBlock
:
self
.
adShowBlock
];
}
else
{
[
self
showAdWithData
:
self
.
cachevideo
.
firstObject
withADType
:
AdType
];
self
.
showNow
=
NO
;
}
}
else
{
[
MBProgressHUD
showLoading
:
@"请稍等..."
];
self
.
showNow
=
YES
;
if
(
!
self
.
haveLodeAD
)
{
...
...
@@ -184,7 +195,17 @@ static IOSADManager * manager = nil;
}];
}
}
//MARK: 广告点击上报
/// 点击事件统计
/// @param adModel 当前广告对象
-
(
void
)
videoAdDidClick
:
(
GYAdsTrackModel
*
)
adModel
;{
[
self
trackingADWith
:
adModel
.
clk_tracking
.
firstObject
];
if
(
self
.
advertisingSpace
)
{
[[
CGUserManager
shared
]
addLocCollection
:
self
.
advertisingSpace
value
:
@"click_reward_video_ad"
];
}
}
/// 加载一条缓存
/// @param loadADModel 广告对象
...
...
@@ -394,6 +415,8 @@ static IOSADManager * manager = nil;
-
(
void
)
requestOpenScreenAD
;{
WEAKSELF
;
[[
CGNetworkTools
shared
]
getWithAdsAction
:
getAdsInfo
parameters
:
@{
@"slotName"
:
@"splash"
}
success
:^
(
id
_Nonnull
response
)
{
[
MBProgressHUD
hideHUD
];
if
([[
response
objectForKey
:
@"status"
]
intValue
]
==
200
)
{
[[
CGUserManager
shared
]
addLocCollection
:
@"splash_request"
value
:
@"splash_request_success"
];
NSMutableArray
*
models
=
[
NSMutableArray
new
];
...
...
@@ -421,6 +444,8 @@ static IOSADManager * manager = nil;
[[
CGUserManager
shared
]
addLocCollection
:
@"splash_request"
value
:
@"splash_request_failed"
];
}
}
failure
:^
(
NSError
*
_Nonnull
error
)
{
[
MBProgressHUD
hideHUD
];
[[
CGUserManager
shared
]
addLocCollection
:
@"splash_request"
value
:
@"splash_request_failed"
];
}];
}
...
...
@@ -428,6 +453,8 @@ static IOSADManager * manager = nil;
-
(
void
)
requestNativeAD
;{
WEAKSELF
;
[[
CGNetworkTools
shared
]
getWithAdsAction
:
getAdsInfo
parameters
:
@{
@"slotName"
:
@"common_bigimage"
}
success
:^
(
id
_Nonnull
response
)
{
[
MBProgressHUD
hideHUD
];
if
([[
response
objectForKey
:
@"status"
]
intValue
]
==
200
)
{
[[
CGUserManager
shared
]
addLocCollection
:
@"native_request"
value
:
@"native_request_success"
];
...
...
@@ -455,6 +482,8 @@ static IOSADManager * manager = nil;
}
}
failure
:^
(
NSError
*
_Nonnull
error
)
{
[
MBProgressHUD
hideHUD
];
[[
CGUserManager
shared
]
addLocCollection
:
@"native_request"
value
:
@"native_request_failed"
];
}];
...
...
@@ -473,6 +502,8 @@ static IOSADManager * manager = nil;
}
[[
CGNetworkTools
shared
]
getWithAdsAction
:
getAdsInfo
parameters
:
@{
@"slotName"
:
@"common_video"
}
success
:^
(
id
_Nonnull
response
)
{
[
MBProgressHUD
hideHUD
];
if
([[
response
objectForKey
:
@"status"
]
intValue
]
==
200
)
{
requestToTry
=
0
;
...
...
@@ -508,14 +539,14 @@ static IOSADManager * manager = nil;
}
else
{
[[
CGUserManager
shared
]
addLocCollection
:
@"reward_request"
value
:
@"reward_request_failed"
];
}
[
MBProgressHUD
hideHUD
];
}
failure
:^
(
NSError
*
_Nonnull
error
)
{
[
MBProgressHUD
hideHUD
];
requestToTry
+=
1
;
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
2
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
weakSelf
requestVideoAD
];
});
[[
CGUserManager
shared
]
addLocCollection
:
@"reward_request"
value
:
@"reward_request_failed"
];
[
MBProgressHUD
hideHUD
];
}];
...
...
@@ -527,25 +558,25 @@ static IOSADManager * manager = nil;
WEAKSELF
;
if
(
success
)
{
//埋点
[
self
trackingADWith
:
model
.
pullsucc_tracking
.
firstObject
];
NSLog
(
@">>>>>>> 缓存 成功 平台 = %@ ID = %@ <<<<<<<<<"
,
model
.
adPlatform
,
model
.
codeId
);
model
.
cacheDate
=
[
NSDate
date
];
// 缓存成功时间
}
else
{
[
self
trackingADWith
:
model
.
pullfail_tracking
.
firstObject
];
NSLog
(
@">>>>>>> 缓存 失败 平台 = %@ ID = %@ <<<<<<<<<"
,
model
.
adPlatform
,
model
.
codeId
);
}
if
(
model
.
loadADType
==
ADType_Video
){
weakSelf
.
haveLodeAD
=
NO
;
[
MBProgressHUD
hideHUD
];
if
(
success
)
{
[[
CGUserManager
shared
]
addLocCollection
:
@"reward_request"
value
:
@"reward_back_success"
];
[
weakSelf
.
cachevideo
addObject
:
model
];
if
(
weakSelf
.
showNow
){
[
weakSelf
showADType
:
ADType_Video
resultBlock
:
self
.
adShowBlock
];
}
}
else
{
[[
CGUserManager
shared
]
addLocCollection
:
@"reward_request"
value
:
@"reward_back_failed"
];
[
weakSelf
clearCache
:
model
];
}
...
...
@@ -553,25 +584,25 @@ static IOSADManager * manager = nil;
}
else
if
(
model
.
loadADType
==
ADType_OpenScreen
){
if
(
success
){
[[
CGUserManager
shared
]
addLocCollection
:
@"splash_back"
value
:
@"splash_back_success"
];
[
weakSelf
.
cacheOpenScreen
addObject
:
model
];
[
weakSelf
showADType
:
ADType_OpenScreen
resultBlock
:
self
.
adShowBlock
];
}
else
{
[[
CGUserManager
shared
]
addLocCollection
:
@"splash_back"
value
:
@"splash_back_failed"
];
[
weakSelf
clearCache
:
model
];
}
}
else
if
(
model
.
loadADType
==
ADType_BigImage
){
//原生
if
(
success
){
[[
CGUserManager
shared
]
addLocCollection
:
@"native_back"
value
:
@"native_back_success"
];
[
weakSelf
.
cacheBigImg
addObject
:
model
];
[
weakSelf
showADType
:
ADType_BigImage
resultBlock
:
self
.
adShowBlock
];
}
else
{
[[
CGUserManager
shared
]
addLocCollection
:
@"native_back"
value
:
@"native_back_failed"
];
[
weakSelf
clearCache
:
model
];
}
...
...
@@ -580,16 +611,19 @@ static IOSADManager * manager = nil;
}
//MARK: 处理加载的回调
//MARK: 处理
展示
加载的回调
-
(
void
)
blockResultShowWithData
:
(
GYAdsTrackModel
*
)
model
andSuccess
:
(
BOOL
)
success
;{
WEAKSELF
;
if
(
success
)
{
//埋点
NSLog
(
@">>>>>>> 缓存 成功 平台 = %@ ID = %@ <<<<<<<<<"
,
model
.
adPlatform
,
model
.
codeId
);
[
self
trackingADWith
:
model
.
imp_tracking
.
firstObject
];
[
self
trackingADWith
:
model
.
playcomplete_trackings
.
firstObject
];
}
else
{
NSLog
(
@">>>>>>> 缓存 失败 平台 = %@ ID = %@ %@ <<<<<<<<<"
,
model
.
adPlatform
,
model
.
codeId
,
model
.
ADError
);
[
self
trackingADWith
:
model
.
showfail_tracking
.
firstObject
];
}
if
(
model
.
loadADType
==
ADType_Video
){
[
weakSelf
clearCache
:
model
];
...
...
@@ -597,17 +631,19 @@ static IOSADManager * manager = nil;
if
(
success
)
{
[[
CGUserManager
shared
]
addLocCollection
:
@"reward_request"
value
:
@"reward_display_success"
];
if
(
self
.
advertisingSpace
)
{
[[
CGUserManager
shared
]
addLocCollection
:
self
.
advertisingSpace
value
:
@"show_suc_reward_viode_ad"
];
}
[[
CGNetworkTools
shared
]
postWithAction
:
adsEndReport
parameters
:@{}
success
:^
(
id
_Nonnull
response
)
{
}
failure
:^
(
NSError
*
_Nonnull
error
)
{
}];
}
else
{
[[
CGUserManager
shared
]
addLocCollection
:
@"reward_request"
value
:
@"reward_display_failed"
];
if
(
self
.
advertisingSpace
)
{
[[
CGUserManager
shared
]
addLocCollection
:
self
.
advertisingSpace
value
:
@""
];
NSString
*
errorValue
=
[
NSString
stringWithFormat
:
@"show_fail_reward_video_ad_%@_%@_%@"
,
model
.
adPlatform
,
model
.
codeId
,
model
.
ADError
];
[[
CGUserManager
shared
]
addLocCollection
:
self
.
advertisingSpace
value
:
errorValue
];
}
}
}
else
if
(
model
.
loadADType
==
ADType_OpenScreen
){
...
...
GYDemo/GYDemo/SCAds/model/GYAdsTrackModel.h
View file @
ba8ac267
...
...
@@ -44,6 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
assign
)
BOOL
firstFailure
;
// 第一个失败
@property
(
nonatomic
,
assign
)
eADType
loadADType
;
//这个广告所属的广告类型
@property
(
nonatomic
,
retain
)
NSError
*
ADError
;
//广告错误回调
@property
(
nonatomic
,
retain
)
NSDate
*
cacheDate
;
//缓存成功时间
+
(
instancetype
)
modelWithDic
:(
NSDictionary
*
)
dict
;
...
...
GYDemo/GYDemo/SCAds/platform/AddCSJADManager.m
View file @
ba8ac267
...
...
@@ -137,7 +137,7 @@
*/
-
(
void
)
splashAdDidClick
:
(
BUSplashAdView
*
)
splashAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
// NSString * clkTracking = self.currentData.clk_tracking[0];
...
...
@@ -279,7 +279,7 @@
This method is called when video ad is clicked. 点击
*/
-
(
void
)
nativeExpressRewardedVideoAdDidClick
:
(
BUNativeExpressRewardedVideoAd
*
)
rewardedVideoAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
}
/**
...
...
@@ -380,7 +380,7 @@
* Sent when an ad view is clicked
*/
-
(
void
)
nativeExpressAdViewDidClick
:
(
BUNativeExpressAdView
*
)
nativeExpressAdView
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
}
...
...
GYDemo/GYDemo/SCAds/platform/AddGDTADManager.m
View file @
ba8ac267
...
...
@@ -130,7 +130,7 @@
* 开屏广告点击回调
*/
-
(
void
)
splashAdClicked
:
(
GDTSplashAd
*
)
splashAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
}
...
...
@@ -235,7 +235,7 @@
@param rewardedVideoAd GDTRewardVideoAd 实例
*/
-
(
void
)
gdt_rewardVideoAdDidClicked
:
(
GDTRewardVideoAd
*
)
rewardedVideoAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
}
...
...
@@ -344,7 +344,7 @@
* 原生模板广告点击回调
*/
-
(
void
)
nativeExpressAdViewClicked
:
(
GDTNativeExpressAdView
*
)
nativeExpressAdView
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
}
...
...
GYDemo/GYDemo/SCAds/platform/AddRuiShiADManager.m
View file @
ba8ac267
...
...
@@ -108,7 +108,7 @@
开屏广告点击回调
*/
-
(
void
)
vl_splashAdDidClick
:
(
VLNSplashAd
*
)
splashAd
{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
}
...
...
@@ -162,7 +162,7 @@
视频广告信息点击回调
*/
-
(
void
)
vl_rewardVideoAdDidClicked
:
(
VLNRewardedVideoAd
*
)
rewardedVideoAd
{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
}
...
...
@@ -233,7 +233,7 @@
广告点击回调
*/
-
(
void
)
vl_nativeAdDidClick
:
(
VLNNativeAd
*
)
nativeAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
}
/**
...
...
GYDemo/GYDemo/SCAds/platform/AddSigmobADManager.m
View file @
ba8ac267
...
...
@@ -97,7 +97,7 @@
* 开屏广告点击回调
*/
-
(
void
)
onSplashAdClicked
:
(
WindSplashAd
*
)
splashAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
}
...
...
@@ -186,7 +186,7 @@
@param placementId 广告位Id
*/
-
(
void
)
onVideoAdClicked
:
(
NSString
*
)
placementId
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
[
self
videoAdDidClick
:
self
.
currentData
];
}
...
...
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