update: 更新属性赋值的优先顺序, 修复丢失属性的 BUG
Signed-off-by: huyufei <yufei.hu@castbox.fm>
parent
4adffcd4a7
commit
81cb45c46d
|
|
@ -113,12 +113,15 @@ namespace Guru
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void FlushAll()
|
private void FlushAll()
|
||||||
{
|
{
|
||||||
while(_eventBuffer.Pop(out var trackingEvent))
|
// #1. 先尝试执行所有预定义的用户属性
|
||||||
|
foreach (var propertyAction in _predefinedPropertyDelayedActions)
|
||||||
{
|
{
|
||||||
Debug.Log($"[ANU][GA] --- FlushAll Events: {trackingEvent.eventName}");
|
Debug.Log($"[ANU][GA] --- FlushAll predefined Properties: {propertyAction.key}:{ propertyAction}");
|
||||||
FlushTrackingEvent(trackingEvent);
|
propertyAction.Execute();
|
||||||
}
|
}
|
||||||
|
_predefinedPropertyDelayedActions.Clear();
|
||||||
|
|
||||||
|
// #2. 设置所有的用户属性
|
||||||
foreach (var key in _userPropertyMap.Keys)
|
foreach (var key in _userPropertyMap.Keys)
|
||||||
{
|
{
|
||||||
Debug.Log($"[ANU][GA] --- FlushAll Properties: {key}:{ _userPropertyMap[key]}");
|
Debug.Log($"[ANU][GA] --- FlushAll Properties: {key}:{ _userPropertyMap[key]}");
|
||||||
|
|
@ -126,13 +129,12 @@ namespace Guru
|
||||||
}
|
}
|
||||||
_userPropertyMap.Clear();
|
_userPropertyMap.Clear();
|
||||||
|
|
||||||
|
// #3. 发送所有的用户事件, 一定要在设置用户属性之后再调用事件, 这样才能携带所有的属性!!
|
||||||
foreach (var propertyAction in _predefinedPropertyDelayedActions)
|
while(_eventBuffer.Pop(out var trackingEvent))
|
||||||
{
|
{
|
||||||
Debug.Log($"[ANU][GA] --- FlushAll predefined Properties: {propertyAction.key}:{ propertyAction}");
|
Debug.Log($"[ANU][GA] --- FlushAll Events: {trackingEvent.eventName}");
|
||||||
propertyAction.Execute();
|
FlushTrackingEvent(trackingEvent);
|
||||||
}
|
}
|
||||||
_predefinedPropertyDelayedActions.Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue