This commit is contained in:
wangcongtao
2020-04-22 17:11:29 +08:00
parent ed5b631a78
commit 4f0e5bd617
4 changed files with 78 additions and 23 deletions

View File

@@ -54,7 +54,7 @@ MOGO_MODULE_GUIDE_VERSION=1.0.3.8
## 工程外部模块
# 探路
MOGO_MODULE_TANLU_VERSION=1.0.4.3
MOGO_MODULE_TANLU_VERSION=1.0.4.5
# 车聊聊
CARCHATTING_VERSION=1.0.3.2-SNAPSHOT
# 车聊聊接口
@@ -74,4 +74,4 @@ MOGO_MODULE_PUSH_VERSION=1.0.1
# 广告资源位
MOGO_MODULE_AD_CARD_VERSION=1.0.1
# 新鲜事
MOGO_MODULE_FRESH_NEWS_VERSION=1.0.3.3
MOGO_MODULE_FRESH_NEWS_VERSION=1.0.3.2

View File

@@ -27,9 +27,13 @@ import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerShareMusic;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.extensions.ExtensionsModuleConst;
import com.mogo.module.main.MainActivity;
import com.mogo.module.main.registercenter.MogoRegisterCenterHandler;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
@@ -611,6 +615,7 @@ public class MogoModulesManager implements MogoModulesHandler,
IMogoMarkerClickListener listener = MogoRegisterCenterHandler.getInstance().getMarkerListener( marker.getOwner() );
if ( listener != null ) {
try {
trackMarkerClickEvent( marker );
return listener.onMarkerClicked( marker );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
@@ -619,6 +624,28 @@ public class MogoModulesManager implements MogoModulesHandler,
return false;
}
/**
* marker 点击埋点
*
* @param marker
*/
private void trackMarkerClickEvent( IMogoMarker marker ) {
if ( marker == null || TextUtils.isEmpty( marker.getOwner() )) {
return;
}
// 数据统计代码
final Map< String, Object > properties = new HashMap<>();
properties.put( "poitype", marker.getOwner() );
MarkerShowEntity showEntity = ( MarkerShowEntity ) marker.getObject();
Object bindObj = showEntity.getBindObj();
if ( bindObj instanceof MarkerNoveltyInfo ) {
properties.put( "contenttype", ( ( MarkerNoveltyInfo ) bindObj ).getPoiType() );
} else if( bindObj instanceof MarkerShareMusic ){
properties.put( "contenttype", ( ( MarkerShareMusic ) bindObj ).getShareType()+"" );
}
MarkerServiceHandler.getMogoAnalytics().track( "Launcher_Icon_Click", properties );
}
@Override
public void onUpdateTraffic2( MogoTraffic traffic ) {
Iterator< IMogoAimlessModeListener > iterator = MogoRegisterCenterHandler.getInstance().getAimlessModeListeners();

View File

@@ -787,13 +787,9 @@ public class MogoServices implements IMogoMapListener,
mStatusManager.setVoiceUIShow( TAG, true );
}
} else if ( ServiceConst.COMMAND_NEXT.equals( command ) ) {
if ( mStatusManager.isMainPageOnResume() ) {
mActionManager.invoke( MapMarkerManager.getInstance().getCurrentModuleName(), MogoAction.Next );
}
onActionDown( MogoAction.Next );
} else if ( ServiceConst.COMMAND_PREVIOUS.equals( command ) ) {
if ( mStatusManager.isMainPageOnResume() ) {
mActionManager.invoke( MapMarkerManager.getInstance().getCurrentModuleName(), MogoAction.Prev );
}
onActionDown( MogoAction.Prev );
} else if ( ServiceConst.COMMAND_SWITCH_CARD.equals( command ) ) {
IntentHandlerFactory.getInstance().handle( mContext, command, intent );
} else if ( MogoReceiver.ACTION_ADAS_STATUS.equals( command ) ) {
@@ -884,9 +880,9 @@ public class MogoServices implements IMogoMapListener,
@Override
public void onCmdSelected( String cmd ) {
if ( TextUtils.equals( ServiceConst.CMD_UN_WAKE_PREV, cmd ) ) {
mActionManager.invoke( MapMarkerManager.getInstance().getCurrentModuleName(), MogoAction.Prev );
onActionDown( MogoAction.Prev );
} else if ( TextUtils.equals( ServiceConst.CMD_UN_WAKE_NEXT, cmd ) ) {
mActionManager.invoke( MapMarkerManager.getInstance().getCurrentModuleName(), MogoAction.Next );
onActionDown( MogoAction.Next );
} else if ( TextUtils.equals( ServiceConst.CMD_UN_WAKEUP_MY_LOCATION, cmd ) ) {
if ( mStatusManager.isMainPageOnResume() ) {
mUiController.recoverLockMode();
@@ -896,6 +892,19 @@ public class MogoServices implements IMogoMapListener,
}
}
private void onActionDown(MogoAction action){
if ( !mStatusManager.isMainPageOnResume() ) {
return;
}
if ( mStatusManager.isADASShow() ) {
// 分发到V2X
mActionManager.invoke( "V2X_UI", action );
} else {
String biz = MapMarkerManager.getInstance().getCurrentModuleName();
mActionManager.invoke( biz, action );
}
}
@Override
public void onCmdAction( String speakText ) {

View File

@@ -144,16 +144,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
if (!result) {
return false;
}
// 数据统计代码
final Map<String, Object> properties = new HashMap<>();
properties.put( "poitype", mLastCheckMarker.getOwner() );
MarkerShowEntity showEntity = (MarkerShowEntity) mLastCheckMarker.getObject();
Object bindObj = showEntity.getBindObj();
if (bindObj instanceof MarkerNoveltyInfo) {
properties.put( "contenttype", ((MarkerNoveltyInfo) bindObj).getPoiType() );
}
MarkerServiceHandler.getMogoAnalytics().track("Launcher_Icon_Click", properties);
} catch (Exception e) {
e.printStackTrace();
}
@@ -609,11 +599,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
fillPoiTypeTrackBody(array, ModuleNames.CARD_TYPE_USER_DATA, size);
size = exploreWayList == null ? 0 : exploreWayList.size();
fillPoiTypeTrackBody(array, ModuleNames.CARD_TYPE_ROAD_CONDITION, size);
size = shareMusicList == null ? 0 : shareMusicList.size();
fillPoiTypeTrackBody(array, ModuleNames.CARD_TYPE_SHARE_MUSIC, size);
size = noveltyInfoList == null ? 0 : noveltyInfoList.size();
JSONObject novelty = fillPoiTypeTrackBody(array, ModuleNames.CARD_TYPE_NOVELTY, size);
if (noveltyInfoList != null) {
JSONObject novelty = fillPoiTypeTrackBody(array, ModuleNames.CARD_TYPE_NOVELTY, size);
Map<String, Integer> counter = new HashMap<>( );
for (MarkerNoveltyInfo markerNoveltyInfo : noveltyInfoList) {
if (markerNoveltyInfo == null) {
@@ -641,6 +630,36 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
}
}
size = shareMusicList == null ? 0 : shareMusicList.size();
JSONObject shareMusic = fillPoiTypeTrackBody(array, ModuleNames.CARD_TYPE_SHARE_MUSIC, size);
if (shareMusicList != null) {
Map<String, Integer> counter = new HashMap<>( );
for (MarkerShareMusic markerShareMusic : shareMusicList) {
if (markerShareMusic == null) {
continue;
}
String childType = markerShareMusic.getShareType()+"";
if ( !counter.containsKey( childType ) ) {
counter.put( childType, 0 );
}
int s = counter.get( childType ).intValue();
counter.put( childType, s+1 );
}
if ( !counter.isEmpty() ) {
JSONArray shareMusicJsonArray = new JSONArray();
for ( Map.Entry< String, Integer > entry : counter.entrySet() ) {
fillPoiChildTypeTrackBody(shareMusicJsonArray, entry.getKey(), entry.getValue());
}
if ( shareMusicJsonArray.length() > 0 ) {
try {
shareMusic.put( "content", shareMusicJsonArray );
} catch ( JSONException e ) {
e.printStackTrace();
}
}
}
}
try {
if (array.length() == 0) {
return;