我们将Google跟踪代码管理器和Firebase集成到我们的iOS应用中。一切似乎都正确集成(应用程序加载默认和远程定义的容器并将事件发送到Firebase,应用程序在预览QR代码上打开)。
但我很难在未发布的版本上使用预览功能。
我的所作所为:
注意:我知道使用了版本4,因为我的标签通过添加后缀来重命名事件名称,后者在版本4和5上有所不同。我可以在调试控制台中看到跟踪的内容。
在日志中我看到:
<FIRAnalytics/DEBUG> Deep Link does not contain valid required params. URL params: {
"gtm_auth" = 7xxhnmjdIb71fZ28PDPmXg;
"gtm_preview" = 5;
id = "GTM-XXXXXX";
}
这是我的容器定义(json) - 版本5:
{
"fingerprint":"NQ$0",
"resource": {
"version":"5",
"macros":[
{
"function":"__e",
"instance_name":"Event Name",
"vendor_template_version":"1"
},
{
"function":"__ai",
"instance_name":"App ID",
"vendor_template_version":"1"
},
{
"function":"__an",
"instance_name":"App Name",
"vendor_template_version":"1"
},
{
"function":"__av",
"instance_name":"App Version Code",
"vendor_template_version":"1"
}
],
"tags":[
{
"function":"__fm",
"instance_name":"Firebase X Tag",
"once_per_event":true,
"vendor_template_version":"1",
"vtp_overrideEventName":["template",["macro",0],"zz"],
"vtp_action":"filter",
"tag_id":2
}
],
"predicates":[
{
"function":"_sw",
"arg0":["macro",0],
"arg1":"test"
}
],
"rules":[
[["if",0],["add",0]]
]
},
"runtime":
[[50,"__ai_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationId",[7]]]],[50,"__ai",[46,"data"],[36,["__ai_main",[15,"data"]]]],
[50,"__an_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationName",[7]]]],[50,"__an",[46,"data"],[36,["__an_main",[15,"data"]]]],
[50,"__av_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationVersion",[7]]]],[50,"__av",[46,"data"],[36,["__av_main",[15,"data"]]]],
[50,"__e_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"event",[7]]]],[50,"__e",[46,"data"],[36,["__e_main",[15,"data"]]]],
[50,"__fm_main",[46,"a"],[41,"b","c"],[38,[17,[15,"a"],"action"],[46,"measure","filter","block"],[46,[5,[46,[3,"b",[39,[17,[15,"a"],"mergeEventParameters"],[17,[15,"a"],"dropParamTable"],[7]]],["__fm_sendFirebaseEvent",[17,[15,"a"],"eventName"],[17,[15,"a"],"editParamTable"],[15,"b"],[17,[15,"a"],"mergeEventParameters"]],[4]]],[5,[46,[3,"c",[30,[17,[15,"a"],"overrideEventName"],[2,[17,[15,"gtmUtils"],"mobile"],"event",[7]]]],["__fm_sendFirebaseEvent",[15,"c"],[17,[15,"a"],"editParamTable"],[17,[15,"a"],"dropParamTable"],true],[2,[17,[15,"gtmUtils"],"mobile"],"suppressPassthrough",[7]],[4]]],[5,[46,[2,[17,[15,"gtmUtils"],"mobile"],"suppressPassthrough",[7]],[4]]],[9,[46,[36]]]]]],[50,"__fm_sendFirebaseEvent",[46,"a","b","c","d"],[41,"e","f","g","h","i","j"],[3,"e",[30,[2,[17,[15,"gtmUtils"],"common"],"tableToMap",[7,[15,"b"],"editParamKey","editParamValue"]],[8]]],[22,[28,["__fm_validateEventData",[15,"a"],[15,"e"]]],[46,[36]]],[3,"f",[7]],[47,"g",[15,"c"],[46,[2,[15,"f"],"push",[7,[16,[16,[15,"c"],[15,"g"]],"dropParamKey"]]]]],[3,"h",[39,[15,"d"],[2,[17,[15,"gtmUtils"],"mobile"],"eventParameters",[7]],[8]]],[3,"h",[30,[15,"h"],[8]]],[47,"i",[15,"e"],[46,[22,[12,[2,[15,"f"],"indexOf",[7,[15,"i"]]],[27,1]],[46,[43,[15,"h"],[15,"i"],[16,[15,"e"],[15,"i"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,"Dropped param ",[15,"i"]]," is also specified in param override table"]]]]]]],[3,"j",[8]],[47,"i",[15,"h"],[46,[22,[12,[2,[15,"f"],"indexOf",[7,[15,"i"]]],[27,1]],[46,[43,[15,"j"],[15,"i"],[16,[15,"h"],[15,"i"]]]]]]],[2,[17,[15,"gtmUtils"],"mobile"],"sendMeasurement",[7,[15,"a"],[15,"j"]]]],[50,"__fm_validateEventData",[46,"a","b"],[41,"c"],[22,[30,[12,[2,[15,"a"],"charAt",[7,0]],"_"],[28,[2,[15,"a"],"match",[7,"^[A-Za-z0-9_]*$"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,[0,"Invalid Event name: ",[15,"a"]]," (Must not start with an underscore and must consist of letters,"]," digits and/or underscores)"]]],[36,false]]],[47,"c",[15,"b"],[46,[22,[30,[12,[2,[15,"c"],"charAt",[7,0]],"_"],[28,[2,[15,"c"],"match",[7,"^[A-Za-z0-9_]*$"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,[0,"Invalid parameter name: ",[15,"c"]]," (Must not start with an underscore and must consist of"]," letters, digits and/or underscores)"]]],[36,false]]]]],[36,true]],[50,"__fm",[46,"data"],[36,["__fm_main",[15,"data"]]]],
[50,"main",[46,"a"],[43,[17,[15,"a"],"common"],"tableToMap",[15,"tableToMap"]],[43,[17,[15,"a"],"common"],"stringify",[15,"stringify"]]],[50,"tableToMap",[46,"a","b","c"],[41,"d","e","f"],[3,"d",[8]],[3,"e",false],[3,"f",0],[42,[1,[15,"a"],[23,[15,"f"],[17,[15,"a"],"length"]]],[33,[15,"f"],[3,"f",[0,[15,"f"],1]]],false,[46,[22,[1,[1,[16,[15,"a"],[15,"f"]],[2,[16,[15,"a"],[15,"f"]],"hasOwnProperty",[7,[15,"b"]]]],[2,[16,[15,"a"],[15,"f"]],"hasOwnProperty",[7,[15,"c"]]]],[46,[43,[15,"d"],[16,[16,[15,"a"],[15,"f"]],[15,"b"]],[16,[16,[15,"a"],[15,"f"]],[15,"c"]]],[3,"e",true]]]]],[36,[39,[15,"e"],[15,"d"],[45]]]],[50,"stringify",[46,"a"],[41,"b","c","d","e"],[22,[20,[15,"a"],[45]],[46,[36,"null"]]],[22,[20,[15,"a"],[44]],[46,[36,[44]]]],[22,[30,[12,[40,[15,"a"]],"number"],[12,[40,[15,"a"]],"boolean"]],[46,[36,[2,[15,"a"],"toString",[7]]]]],[22,[12,[40,[15,"a"]],"string"],[46,[36,[0,[0,"\"",[2,[2,[15,"a"],"split",[7,"\""]],"join",[7,"\\\""]]],"\""]]]],[22,[2,[17,[15,"gtmUtils"],"common"],"isArray",[7,[15,"a"]]],[46,[3,"b",[7]],[3,"c",0],[42,[23,[15,"c"],[17,[15,"a"],"length"]],[33,[15,"c"],[3,"c",[0,[15,"c"],1]]],false,[46,[3,"d",["stringify",[16,[15,"a"],[15,"c"]]]],[22,[12,[15,"d"],[44]],[46,[2,[15,"b"],"push",[7,"null"]]],[46,[2,[15,"b"],"push",[7,[15,"d"]]]]]]],[36,[0,[0,"[",[2,[15,"b"],"join",[7,","]]],"]"]]]],[22,[12,[40,[15,"a"]],"object"],[46,[3,"b",[7]],[47,"e",[15,"a"],[46,[3,"d",["stringify",[16,[15,"a"],[15,"e"]]]],[22,[29,[15,"d"],[44]],[46,[2,[15,"b"],"push",[7,[0,[0,[0,"\"",[15,"e"]],"\":"],[15,"d"]]]]]]]],[36,[0,[0,"{",[2,[15,"b"],"join",[7,","]]],"}"]]]],[2,[17,[15,"gtmUtils"],"common"],"log",[7,"e","Attempting to stringify unknown type!"]],[36,[44]]]]
}
容器版本4:
{
"fingerprint":"NA$0",
"resource": {
"version":"4",
"macros":[
{
"function":"__e",
"instance_name":"Event Name",
"vendor_template_version":"1"
},
{
"function":"__ai",
"instance_name":"App ID",
"vendor_template_version":"1"
},
{
"function":"__an",
"instance_name":"App Name",
"vendor_template_version":"1"
},
{
"function":"__av",
"instance_name":"App Version Code",
"vendor_template_version":"1"
}
],
"tags":[
{
"function":"__fm",
"instance_name":"Firebase X Tag",
"once_per_event":true,
"vendor_template_version":"1",
"vtp_overrideEventName":["template",["macro",0],"yy"],
"vtp_action":"filter",
"tag_id":2
}
],
"predicates":[
{
"function":"_sw",
"arg0":["macro",0],
"arg1":"test"
}
],
"rules":[
[["if",0],["add",0]]
]
},
"runtime":
[[50,"__ai_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationId",[7]]]],[50,"__ai",[46,"data"],[36,["__ai_main",[15,"data"]]]],
[50,"__an_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationName",[7]]]],[50,"__an",[46,"data"],[36,["__an_main",[15,"data"]]]],
[50,"__av_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationVersion",[7]]]],[50,"__av",[46,"data"],[36,["__av_main",[15,"data"]]]],
[50,"__e_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"event",[7]]]],[50,"__e",[46,"data"],[36,["__e_main",[15,"data"]]]],
[50,"__fm_main",[46,"a"],[41,"b","c"],[38,[17,[15,"a"],"action"],[46,"measure","filter","block"],[46,[5,[46,[3,"b",[39,[17,[15,"a"],"mergeEventParameters"],[17,[15,"a"],"dropParamTable"],[7]]],["__fm_sendFirebaseEvent",[17,[15,"a"],"eventName"],[17,[15,"a"],"editParamTable"],[15,"b"],[17,[15,"a"],"mergeEventParameters"]],[4]]],[5,[46,[3,"c",[30,[17,[15,"a"],"overrideEventName"],[2,[17,[15,"gtmUtils"],"mobile"],"event",[7]]]],["__fm_sendFirebaseEvent",[15,"c"],[17,[15,"a"],"editParamTable"],[17,[15,"a"],"dropParamTable"],true],[2,[17,[15,"gtmUtils"],"mobile"],"suppressPassthrough",[7]],[4]]],[5,[46,[2,[17,[15,"gtmUtils"],"mobile"],"suppressPassthrough",[7]],[4]]],[9,[46,[36]]]]]],[50,"__fm_sendFirebaseEvent",[46,"a","b","c","d"],[41,"e","f","g","h","i","j"],[3,"e",[30,[2,[17,[15,"gtmUtils"],"common"],"tableToMap",[7,[15,"b"],"editParamKey","editParamValue"]],[8]]],[22,[28,["__fm_validateEventData",[15,"a"],[15,"e"]]],[46,[36]]],[3,"f",[7]],[47,"g",[15,"c"],[46,[2,[15,"f"],"push",[7,[16,[16,[15,"c"],[15,"g"]],"dropParamKey"]]]]],[3,"h",[39,[15,"d"],[2,[17,[15,"gtmUtils"],"mobile"],"eventParameters",[7]],[8]]],[3,"h",[30,[15,"h"],[8]]],[47,"i",[15,"e"],[46,[22,[12,[2,[15,"f"],"indexOf",[7,[15,"i"]]],[27,1]],[46,[43,[15,"h"],[15,"i"],[16,[15,"e"],[15,"i"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,"Dropped param ",[15,"i"]]," is also specified in param override table"]]]]]]],[3,"j",[8]],[47,"i",[15,"h"],[46,[22,[12,[2,[15,"f"],"indexOf",[7,[15,"i"]]],[27,1]],[46,[43,[15,"j"],[15,"i"],[16,[15,"h"],[15,"i"]]]]]]],[2,[17,[15,"gtmUtils"],"mobile"],"sendMeasurement",[7,[15,"a"],[15,"j"]]]],[50,"__fm_validateEventData",[46,"a","b"],[41,"c"],[22,[30,[12,[2,[15,"a"],"charAt",[7,0]],"_"],[28,[2,[15,"a"],"match",[7,"^[A-Za-z0-9_]*$"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,[0,"Invalid Event name: ",[15,"a"]]," (Must not start with an underscore and must consist of letters,"]," digits and/or underscores)"]]],[36,false]]],[47,"c",[15,"b"],[46,[22,[30,[12,[2,[15,"c"],"charAt",[7,0]],"_"],[28,[2,[15,"c"],"match",[7,"^[A-Za-z0-9_]*$"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,[0,"Invalid parameter name: ",[15,"c"]]," (Must not start with an underscore and must consist of"]," letters, digits and/or underscores)"]]],[36,false]]]]],[36,true]],[50,"__fm",[46,"data"],[36,["__fm_main",[15,"data"]]]],
[50,"main",[46,"a"],[43,[17,[15,"a"],"common"],"tableToMap",[15,"tableToMap"]],[43,[17,[15,"a"],"common"],"stringify",[15,"stringify"]]],[50,"tableToMap",[46,"a","b","c"],[41,"d","e","f"],[3,"d",[8]],[3,"e",false],[3,"f",0],[42,[1,[15,"a"],[23,[15,"f"],[17,[15,"a"],"length"]]],[33,[15,"f"],[3,"f",[0,[15,"f"],1]]],false,[46,[22,[1,[1,[16,[15,"a"],[15,"f"]],[2,[16,[15,"a"],[15,"f"]],"hasOwnProperty",[7,[15,"b"]]]],[2,[16,[15,"a"],[15,"f"]],"hasOwnProperty",[7,[15,"c"]]]],[46,[43,[15,"d"],[16,[16,[15,"a"],[15,"f"]],[15,"b"]],[16,[16,[15,"a"],[15,"f"]],[15,"c"]]],[3,"e",true]]]]],[36,[39,[15,"e"],[15,"d"],[45]]]],[50,"stringify",[46,"a"],[41,"b","c","d","e"],[22,[20,[15,"a"],[45]],[46,[36,"null"]]],[22,[20,[15,"a"],[44]],[46,[36,[44]]]],[22,[30,[12,[40,[15,"a"]],"number"],[12,[40,[15,"a"]],"boolean"]],[46,[36,[2,[15,"a"],"toString",[7]]]]],[22,[12,[40,[15,"a"]],"string"],[46,[36,[0,[0,"\"",[2,[2,[15,"a"],"split",[7,"\""]],"join",[7,"\\\""]]],"\""]]]],[22,[2,[17,[15,"gtmUtils"],"common"],"isArray",[7,[15,"a"]]],[46,[3,"b",[7]],[3,"c",0],[42,[23,[15,"c"],[17,[15,"a"],"length"]],[33,[15,"c"],[3,"c",[0,[15,"c"],1]]],false,[46,[3,"d",["stringify",[16,[15,"a"],[15,"c"]]]],[22,[12,[15,"d"],[44]],[46,[2,[15,"b"],"push",[7,"null"]]],[46,[2,[15,"b"],"push",[7,[15,"d"]]]]]]],[36,[0,[0,"[",[2,[15,"b"],"join",[7,","]]],"]"]]]],[22,[12,[40,[15,"a"]],"object"],[46,[3,"b",[7]],[47,"e",[15,"a"],[46,[3,"d",["stringify",[16,[15,"a"],[15,"e"]]]],[22,[29,[15,"d"],[44]],[46,[2,[15,"b"],"push",[7,[0,[0,[0,"\"",[15,"e"]],"\":"],[15,"d"]]]]]]]],[36,[0,[0,"{",[2,[15,"b"],"join",[7,","]]],"}"]]]],[2,[17,[15,"gtmUtils"],"common"],"log",[7,"e","Attempting to stringify unknown type!"]],[36,[44]]]]
}
答案 0 :(得分:0)
确保清除设备上的Cookie。此外,停止任何脚本或广告拦截服务在后台运行,这也可能会干扰GTM的预览模式。
免责声明:这可能不适用于您的设置,我只能代表桌面环境。
答案 1 :(得分:0)
您是否按照this tutorial中描述的所有步骤操作了? 特别是在plist文件中添加网址类型的部分。
卸载并重新安装应用程序,而不是QR代码,直接使用链接。作为最后一个选项,请在模拟器上而不是在真实设备上尝试此操作。