Flutter 3.X.X Migration Guide
Changes
The method used in v2.X.X has been deprecated and replaced with the following.
static void trackEvent(String category, [ AirbridgeEventOption? option ]) {
event.trackEvent(category, option);
}
option
can be null, or it can also be used with action
, label
, value
, customAttributes
and semanticAttributes
.
Please refer to Event Setup for details.
If you were using SDK v2.X.X, please switch to trackEvent(String category, [ AirbridgeEventOption? option ])
to track events.
User Events
Sign Up
- Airbridge.event.send(SignUpEvent(user: user));
+ Airbridge.state.setUser(User(
+ ID: ...,
+ email: ...,
+ phone: ...,
+ alias: {},
+ attributes: {},
+ ));
+ Airbridge.trackEvent(AirbridgeCategory.SIGN_UP, option);
Changes need to be made if you were using Airbridge.event.send(SignUpEvent(user: user))
.
Instead of passing user information through the user
parameter, fill in Airbridge.state.setUser()
and forward the sign up event using Airbridge.trackEvent(AirbridgeCategory.SIGN_UP, option)
.
Sign In
- Airbridge.event.send(SignInEvent(user: user));
+ Airbridge.state.setUser(User(
+ ID: ...,
+ email: ...,
+ phone: ...,
+ alias: {},
+ attributes: {},
+ ));
+ Airbridge.trackEvent(AirbridgeCategory.SIGN_IN, option);
Changes need to be made if you were using Airbridge.event.send(SignInEvent(user: user))
.
Instead of passing user information through the user
parameter, fill in Airbridge.state.setUser()
and forward the sign in event using Airbridge.trackEvent(AirbridgeCategory.SIGN_IN, option)
.
Sign Out
- Airbridge.event.send(SignOutEvent());
+ Airbridge.trackEvent(AirbridgeCategory.SIGN_OUT, option);
+ Airbridge.state.setUser(User());
Changes need to be made if you were using Airbridge.event.send(SignOutEvent())
.
Sign out using Airbridge.trackEvent(AirbridgeCategory.SIGN_OUT, option)
and then empty user information using Airbridge.state.setUser(())
.
E-commerce Events
E-commerce Events Documentation
View Home Screen
- Airbridge.event.send(ViewHomeEvent(
- option: ...
- ));
+ Airbridge.trackEvent(AirbridgeCategory.HOME_VIEW, option);
Airbridge.event.send(ViewHomeEvent())
를 사용하고 있다면 변경이 필요합니다.
Airbridge.trackEvent(AirbridgeCategory.HOME_VIEW, option)
으로 으로 HOME_VIEW
이벤트를 전달합니다.
상품 상세 조회
Changes need to be made if you were using Airbridge.event.send(ViewHomeEvent())
.
Send HOME_VIEW
events using Airbridge.trackEvent(AirbridgeCategory.HOME_VIEW, option)
.
View Product Details
- Airbridge.event.send(ViewProductDetailEvent(
- option: ...,
- products: ...,
- ));
+ Airbridge.event.trackEvent(
+ AirbridgeCategory.PRODUCT_DETAILS_VIEW,
+ AirbridgeEventOption(
+ semanticAttributes: {
+ AirbridgeAttributes.PRODUCTS: [{
+ AirbridgeProduct.PRODUCT_ID: 'coke_zero',
+ AirbridgeProduct.NAME: 'Coke Zero',
+ AirbridgeProduct.PRICE: 1.99,
+ AirbridgeProduct.CURRENCY: 'USD',
+ AirbridgeProduct.POSITION: 1,
+ AirbridgeProduct.QUANTITY: 1,
+ },
+ ]
+ }
+ ));
Changes need to be made if you were using Airbridge.event.send(ViewProductDetailEvent())
.
Send PRODUCT_DETAILS_VIEW
events using Airbridge.trackEvent(AirbridgeCategory.PRODUCT_DETAILS_VIEW, option)
Product details should be sent under
semanticAttributes.[AirbridgeAttributes.PRODUCTS]
.
View Product List
- Airbridge.event.send(ViewProductListEvent(
- option: ...,
- listID: ...,
- products: ...,
- ));
+ Airbridge.event.trackEvent(
+ AirbridgeCategory.PRODUCT_DETAILS_VIEW,
+ AirbridgeEventOption(
+ semanticAttributes: {
+. AirbridgeAttributes.PRODUCT_LIST_ID: 'ID-1234567890',
+ AirbridgeAttributes.PRODUCTS: [{
+ AirbridgeProduct.PRODUCT_ID: 'coke_zero',
+ AirbridgeProduct.NAME: 'Coke Zero',
+ AirbridgeProduct.PRICE: 1.99,
+ AirbridgeProduct.CURRENCY: 'USD',
+ AirbridgeProduct.POSITION: 1,
+ AirbridgeProduct.QUANTITY: 1,
+ }, {
+ AirbridgeProduct.PRODUCT_ID: 'burger_cheese_double',
+ AirbridgeProduct.NAME: 'Double Cheeseburger',
+ AirbridgeProduct.PRICE: 3.99,
+ AirbridgeProduct.CURRENCY: 'USD',
+ AirbridgeProduct.POSITION: 2,
+ AirbridgeProduct.QUANTITY: 1,
+ },
+ ]
+ }
+ ));
Changes need to be made if you were using Airbridge.event.send(ViewProductListEvent())
.
Send PRODUCT_LIST_VIEW
events using Airbridge.trackEvent(AirbridgeCategory.PRODUCT_LIST_VIEW, option)
.
Product details should be sent under
semanticAttributes.[AirbridgeAttributes.PRODUCTS]
.
Product List ID should be sent undersemanticAttributes.[AirbridgeAttributes.PRODUCT_LIST_ID]
.
View Search Result
- Airbridge.event.send(ViewSearchResultEvent(
- option: ...,
- query: ...,
- products: ...,
- ));
+ Airbridge.event.trackEvent(
+ AirbridgeCategory.SEARCH_RESULT_VIEW,
+ AirbridgeEventOption(
+ semanticAttributes: {
+ AirbridgeAttributes.QUERY: 'product',
+ AirbridgeAttributes.PRODUCTS: [{
+ AirbridgeProduct.PRODUCT_ID: 'coke_zero',
+ AirbridgeProduct.NAME: 'product A',
+ AirbridgeProduct.PRICE: 1.99,
+ AirbridgeProduct.CURRENCY: 'USD',
+ AirbridgeProduct.POSITION: 1,
+ AirbridgeProduct.QUANTITY: 1,
+ }, {
+ AirbridgeProduct.PRODUCT_ID: 'burger_cheese_double',
+ AirbridgeProduct.NAME: 'product B',
+ AirbridgeProduct.PRICE: 3.99,
+ AirbridgeProduct.CURRENCY: 'USD',
+ AirbridgeProduct.POSITION: 2,
+ AirbridgeProduct.QUANTITY: 1,
+ },
+ ]
+ }
+ ));
Changes need to be made if you were using Airbridge.event.send(ViewSearchResultEvent()
.
Send SEARCH_RESULT_VIEW
events using Airbridge.trackEvent(AirbridgeCategory.SEARCH_RESULT_VIEW, option)
.
Product details should be sent under
semanticAttributes.[AirbridgeAttributes.PRODUCTS]
.
Query term should be sent undersemanticAttributes.[AirbridgeAttributes.QUERY]
.
Add to Cart
- Airbridge.event.send(AddToCartEvent(
- option: ...,
- cartID: ...,
- products: ...,
- currency: ...,
- totalValue: 30000,
- ));
+ Airbridge.event.trackEvent(
+ AirbridgeCategory.ADD_TO_CART,
+ AirbridgeEventOption(
+ semanticAttributes: {
+ AirbridgeAttributes.CART_ID: 'ID-1234567890',
+ AirbridgeAttributes.CURRENCY: 'USD',
+ AirbridgeAttributes.TOTAL_VALUE: 5.98,
+ AirbridgeAttributes.PRODUCTS: [{
+ AirbridgeProduct.PRODUCT_ID: 'coke_zero',
+ AirbridgeProduct.NAME: 'Coke Zero',
+ AirbridgeProduct.PRICE: 1.99,
+ AirbridgeProduct.CURRENCY: 'USD',
+ AirbridgeProduct.POSITION: 1,
+ AirbridgeProduct.QUANTITY: 1,
+ }, {
+ AirbridgeProduct.PRODUCT_ID: 'burger_cheese_double',
+ AirbridgeProduct.NAME: 'Double Cheeseburger',
+ AirbridgeProduct.PRICE: 3.99,
+ AirbridgeProduct.CURRENCY: 'USD',
+ AirbridgeProduct.POSITION: 2,
+ AirbridgeProduct.QUANTITY: 1,
+ },
+ ]
+ }
+ ));
Changes need to be made if you were using Airbridge.event.send(AddToCartEvent())
.
Send ADD_TO_CART
events using Airbridge.trackEvent(AirbridgeCategory.ADD_TO_CART, option)
.
Product details should be sent under
semanticAttributes.[AirbridgeAttributes.PRODUCTS]
.
Cart ID should be sent undersemanticAttributes.[AirbridgeAttributes.CART_ID]
.
Currency should be sent undersemanticAttributes.[AirbridgeAttributes.CURRENCY]
.
Total value of the products should be sent undersemanticAttributes.[AirbridgeAttributes.TOTAL_VALUE]
.
Purchase
- Airbridge.event.send(PurchaseEvent(
- option: ...,
- cartID: ...,
- products: ...,
- currency: ...,
- totalValue: 30000,
- ));
+ Airbridge.event.trackEvent(
+ AirbridgeCategory.ORDER_COMPLETED,
+ AirbridgeEventOption(
+ semanticAttributes: {
+ AirbridgeAttributes.TRANSACTION_ID: 'transactionID-purchase',
+ AirbridgeAttributes.CURRENCY: 'USD',
+ AirbridgeAttributes.TOTAL_VALUE: 5.98,
+ AirbridgeAttributes.IN_APP_PURCHASED: true,
+ AirbridgeAttributes.PRODUCTS: [{
+ AirbridgeProduct.PRODUCT_ID: 'coke_zero',
+ AirbridgeProduct.NAME: 'Coke Zero',
+ AirbridgeProduct.PRICE: 1.99,
+ AirbridgeProduct.CURRENCY: 'USD',
+ AirbridgeProduct.POSITION: 1,
+ AirbridgeProduct.QUANTITY: 1,
+ }, {
+ AirbridgeProduct.PRODUCT_ID: 'burger_cheese_double',
+ AirbridgeProduct.NAME: 'Double Cheeseburger',
+ AirbridgeProduct.PRICE: 3.99,
+ AirbridgeProduct.CURRENCY: 'USD',
+ AirbridgeProduct.POSITION: 2,
+ AirbridgeProduct.QUANTITY: 1,
+ }
+ ]
+ }
+ ));
Changes need to be made if you were using Airbridge.event.send(PurchaseEvent())
.
Send ORDER_COMPLETED
events using Airbridge.trackEvent(AirbridgeCategory.ORDER_COMPLETED, option)
.
Product details should be sent under
semanticAttributes.[AirbridgeAttributes.PRODUCTS]
.
Transaction ID should be sent undersemanticAttributes.[AirbridgeAttributes.TRANSACTION_ID]
.
Whether or not it was an in app purchase should be sent undersemanticAttributes.[AirbridgeAttributes.IN_APP_PURCHASED]
.
Total value of the products should be sent undersemanticAttributes.[AirbridgeAttributes.TOTAL_VALUE]
.
Custom Events
- Airbridge.event.send(Event(
- category: ...,
- option: ...,
- ));
+ Airbridge.trackEvent(category, option);
Changes need to be made if you were using Airbridge.event.send(Event())
.
Send custom events using Airbridge.trackEvent(category, option)
.