ECOMMERCE_PURCHASE事件自动记录

时间:2017-04-27 03:35:42

标签: android firebase firebase-analytics

每当我使用VALUE参数在Firebase Analytics中传递事件时,都会自动记录ECOMMERCE_PURCHASE的附加事件。

有关可能导致此问题的原因的任何建议?

更新: 与发送事件相关的代码如下:

FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(context);
Bundle bundle = new Bundle();
bundle.putLong(FirebaseAnalytics.Param.QUANTITY, 1);
bundle.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, categoryId);
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, productName);
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, productId);
bundle.putString(FirebaseAnalytics.Param.ITEM_LOCATION_ID, productLocationId);
bundle.putDouble(FirebaseAnalytics.Param.VALUE, productPrice);
bundle.putString(FirebaseAnalytics.Param.CURRENCY, "INR");
bundle.putDouble(FirebaseAnalytics.Param.PRICE, productMRP);
bundle.putString(CUSTOM_PARAM, stringValue);
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.ADD_TO_CART, bundle);

与下面粘贴的问题对应的日志。 根据日志,即使传递的事件是 add_to_cart ,也会记录事件 ecommerce_purchase 。此外, add_to_cart 永远不会被记录。由SDK上传,只上传了 ecommerce_purchase ,这些内容从未被开始过。

05-01 23:29:08.261 13862-17157/com.app.packagename D/FA: Passing event to registered event handler (FE): add_to_cart, Bundle[{item_name=Daawat Super Basmati Rice, quantity=1, item_location_id=16773036, price=150.0, value=150.0, item_category=1164, currency=INR, item_id=26}]
05-01 23:29:08.282 13862-17157/com.app.packagename D/FA: Logging event (FE): ecommerce_purchase, Bundle[{item_name=Daawat Super Basmati Rice, quantity=1.0, item_location_id=16773036, _o=app+gtm, _sc=xxxxxxx, _si=4306584406462471371, price=150.0, value=150.0, item_category=1164, currency=INR, transaction_id=150.0, item_id=26}]
05-01 23:29:08.295 13862-17157/com.app.packagename V/FA: Using measurement service
05-01 23:29:08.295 13862-17157/com.app.packagename V/FA: Connecting to remote service
05-01 23:29:08.474 13862-17157/com.app.packagename D/FA: Connected to remote service
05-01 23:29:08.475 13862-17157/com.app.packagename V/FA: Processing queued up service tasks: 1
05-01 23:29:08.493 16363-17166/? V/FA-SVC: Logging event: origin=app+gtm,name=ecommerce_purchase,params=Bundle[mParcelledData.dataSize=540]
05-01 23:29:08.516 16363-17166/? V/FA-SVC: Saving event, name, data size: ecommerce_purchase, 291
05-01 23:29:08.516 16363-17166/? V/FA-SVC: Event recorded: Event{appId='com.app.packagename', name='ecommerce_purchase', params=Bundle[{item_name=Daawat Super Basmati Rice, quantity=1.0, item_location_id=16773036, _o=app+gtm, _r=1, _sc=xxxxxxx, _si=4306584406462471371, _dbg=1, price=150.0, value=150.0, item_category=1164, currency=INR, transaction_id=150.0, item_id=26}]}
05-01 23:29:08.518 16363-17166/? V/FA-SVC: Upload scheduled in approximately ms: 500
05-01 23:29:08.526 16363-17166/? V/FA-SVC: Background event processing time, ms: 33
05-01 23:29:09.027 16363-16363/? V/FA-SVC: Device receiver got: com.google.android.gms.measurement.UPLOAD
05-01 23:29:09.035 16363-16363/? V/FA-SVC: Device PackageMeasurementService is starting up
05-01 23:29:09.035 16363-16363/? V/FA-SVC: Device PackageMeasurementService called. startId, action: 1, com.google.android.gms.measurement.UPLOAD
05-01 23:29:09.043 16363-17166/? V/FA-SVC: Evaluating filter. audience, filter, event: 2, 0, ecommerce_purchase
05-01 23:29:09.043 16363-17166/? V/FA-SVC: Filter definition: 
                                           event_filter {
                                             filter_id: 0
                                             event_name: ecommerce_purchase
                                             event_count_filter {
                                               comparison_type: EQUAL
                                               comparison_value: 1
                                             }
                                             filters {
                                             }
                                           }
05-01 23:29:09.044 16363-17166/? V/FA-SVC: Event filter result: false
05-01 23:29:09.044 16363-17166/? V/FA-SVC: Evaluating filter. audience, filter, event: 3, 0, ecommerce_purchase
05-01 23:29:09.044 16363-17166/? V/FA-SVC: Filter definition: 
                                           event_filter {
                                             filter_id: 0
                                             event_name: ecommerce_purchase
                                             event_count_filter {
                                               comparison_type: EQUAL
                                               comparison_value: 2
                                             }
                                             filters {
                                             }
                                           }
05-01 23:29:09.045 16363-17166/? V/FA-SVC: Event filter result: false
05-01 23:29:09.050 16363-17166/? V/FA-SVC: Saving bundle, size: 605
05-01 23:29:09.063 16363-17166/? D/FA-SVC: Uploading events. Elapsed time since last upload attempt (ms): 520
05-01 23:29:09.067 16363-17166/? V/FA-SVC: Uploading data. app, uncompressed size, data: com.app.packagename, 701, 
                                           batch {
                                             bundle {
                                               protocol_version: 1
                                               platform: android
                                               gmp_version: 10084
                                               uploading_gmp_version: 10298
                                               config_version: xxxxx
                                               gmp_app_id: xxxxx:android:xxxxx
                                               app_id: com.app.packagename
                                               app_version: 3.2.1-A
                                               app_version_major: 123
                                               firebase_instance_id: xxxxx
                                               dev_cert_hash: -5701045842766466506
                                               app_store: manual_install
                                               upload_timestamp_millis: 1493695749038
                                               start_timestamp_millis: 1493695748257
                                               end_timestamp_millis: 1493695748257
                                               previous_bundle_start_timestamp_millis: 1493695667931
                                               previous_bundle_end_timestamp_millis: 1493695667931
                                               app_instance_id: 4ced0047ca42b3fa88ff294910e9546d
                                               resettable_device_id: 4ffb0e11-3cf6-4de5-8e3b-e3741424c630
                                               limited_ad_tracking: false
                                               os_version: 7.0
                                               device_model: Nexus 6
                                               user_default_language: en-us
                                               time_zone_offset_minutes: -240
                                               bundle_sequential_index: 43
                                               service_upload: true
                                               user_property {
                                                 set_timestamp_millis: 1493633846756
                                                 name: _fot
                                                 int_value: 1493636400000
                                               }
                                               user_property {
                                                 set_timestamp_millis: 1493695748504
                                                 name: _ltv_INR
                                                 int_value: 1650000000
                                               }
                                               audience_membership {
                                                 audience_id: 2
                                                 new_audience: true
                                                 current_data {
                                                   results: 
                                                   status: 1
                                                 }
                                               }
                                               audience_membership {
                                                 audience_id: 3
                                                 new_audience: true
                                                 current_data {
                                                   results: 
                                                   status: 1
                                                 }
                                               }
                                               event {
                                                 name: ecommerce_purchase
                                                 timestamp_millis: 1493695748257
                                                 previous_timestamp_millis: 1493639625256
                                                 param {
                                                   name: item_name
                                                   string_value: Daawat Super Basmati Rice
                                                 }
                                                 param {
                                                   name: quantity
                                                   double_value: 1.0
                                                 }
                                                 param {
                                                   name: item_location_id
                                                   string_value: 16773036
                                                 }
                                                 param {
                                                   name: _o
                                                   string_value: app+gtm
                                                 }
                                                 param {
                                                   name: _r
                                                   int_value: 1
                                                 }
                                                 param {
                                                   name: _sc
                                                   string_value: xxxxxxx
                                                 }
                                                 param {
                                                   name: _si
                                                   int_value: 4306584406462471371
                                                 }
                                                 param {
                                                   name: _dbg
                                                   int_value: 1
                                                 }
                                                 param {
                                                   name: price
                                                   double_value: 150.0
                                                 }
                                                 param {
                                                   name: value
                                                   double_value: 150.0
                                                 }
                                                 param {
                                                   name: item_category
                                                   string_value: 1164
                                                 }
                                                 param {
                                                   name: currency
                                                   string_value: INR
                                                 }
                                                 param {
                                                   name: transaction_id
                                                   double_value: 150.0
                                                 }
                                                 param {
                                                   name: item_id
                                                   string_value: 26
                                                 }
                                               }
                                             }
                                           }

1 个答案:

答案 0 :(得分:0)

我想我明白了这个问题。您所看到的是Play设备上事件记录过程的两个部分。标有" FA"的邮件SDK正在您的应用中编写。使用" FA-SVC"标记的消息由Play Services撰写。您所看到的是同一事件首先报告为您的应用记录,然后报告为Play服务记录。它不是两个单独的事件,它只是从软件的一个部分传递到另一个部分的同一事件。如果您担心重复事件,请在日志中进一步查看实际上传事件的日志,我们认为您只会看到只有一个ecommerce_purchase事件被上传。