facebookincubator / ConversionsAPI-Tag-for-GoogleTagManager

This repository will contain the artifacts needed for setting up Conversions API implementation on Google Tag Manager's serverside. Please follow the instructions https://www.facebook.com/business/help/702509907046774
Apache License 2.0
64 stars 30 forks source link

BUG: You need to check for user_data.address before accessing its properties #3

Closed sahava closed 3 years ago

sahava commented 3 years ago

If user_data.address doesn't exist in the eventModel, then this line (and all subsequent attempts to access user_data.address will throw an error):

https://github.com/facebookincubator/ConversionsAPI-Tag-for-GoogleTagManager/blob/953ee4420ce0308d124a0dd0f7f5a1392d7eefcb/template.tpl#L190

So it should be something like:

(event_model.user_data != null && event_model.user_data.address != null ? ...

sahava commented 3 years ago

PR here: https://github.com/facebookincubator/ConversionsAPI-Tag-for-GoogleTagManager/pull/6