Homepage Log Event
We track homepage interaction events to measure user behavior and optimize section performance across platforms. We have implemented the following events in our current homepage for CleverTap, Facebook, and Google.
Trigger: when clicking restaurant card Event Name: Homepage Section Tapped (Restaurant Object) Event Property:
| property name | property value | notes |
|---|---|---|
| section_name | New Restaurants | from title |
| section_template | outlet_4_card | from section_template |
| restaurant_id | 997 | |
| restaurant_name_en | Cafe Claire | |
| restaurant_name_th | Cafe Claire TH | |
| branch_id | 12 | (if any, not mandatory) |
| position | 3 | restaurant position |
Trigger: when clicking tag (cuisine, dining style, location) Event Name: Homepage Section Tapped (Tags Object) Event Property:
| property name | property value | notes |
|---|---|---|
| section_name | Top Cuisine | from title |
| section_template | tag_default | from section_template |
| tag_id | 10 | |
| tag_name | International | |
| tag_name_en | International | |
| tag_type | cuisine | |
| position | 3 | tag position |
Trigger: when clicking banner promotions Event Name: Homepage Section Tapped (Banner Promotions) Event Property:
| property name | property value | notes |
|---|---|---|
| section_name | Promotions | from title |
| section_template | promotion_banner | from section_template |
| banner_name | Mala Hub | |
| target_url | https://web.hungryhub.com/restaurants/group/mala-hub?locale=en | |
| position | 4 | banner position |
Trigger: when clicking group card Event Name: Homepage Section Tapped (Group Card) Event Property:
| property name | property value | notes |
|---|---|---|
| section_name | Trending | from title |
| section_template | group_card | from section_template |
| slug | trending |
Trigger: when clicking hh special Event Name: Homepage Section Tapped (HH Specials) Event Property:
| property name | property value | notes |
|---|---|---|
| section_name | Hungry Hub Special | from title |
| section_template | hh_special | from section_template |
| icon_name | Most Loved by Users | |
| target_url | https://web.hungryhub.com/restaurants/search?sort=most_reviewed&locale=th | |
| position | 4 | icon position |
Trigger: when clicking homepage icon Event Name: Homepage Section Tapped (Homepage Icons) Event Property:
| property name | property value | notes |
|---|---|---|
| section_name | Hungry Hub Icon | from title |
| section_template | homepage_icon | from section_template |
| title_name | All You Can Eat | |
| target_url | https://web.hungryhub.com/restaurants/search?tag_id%5B%5D=1541&tag_name%5B%5D=All+You+Can+Eat | |
| position | 4 | icon position |
| type | url_base | tag_base/url_base |
Hybrid Event: onFacebookPushEvent Response:
{
"event_name": "Homepage Section Tapped",
"data": {
"section_name": "New Restaurants",
"section_template": "outlet_4_card",
"restaurant_id": "997"
}
}
in Android:
Bundle params = new Bundle();
params.putString("section_name", "New Restaurants");
params.putString("section_template", "outlet_4_card");
params.putString("restaurant_id", "997");
AppEventsLogger.newLogger(context).logEvent("Homepage Section Tapped", params);
in iOS:
let parameters: [AppEvents.ParameterName: Any] = [
.init("section_name"): "New Restaurants",
.init("section_template"): "outlet_4_card",
.init("restaurant_id"): "997"
]
AppEvents.shared.logEvent(.init("Homepage Section Tapped"), parameters: parameters)
Hybrid Event: onCleverTapPushEvent Response:
{
"event_name": "Homepage Section Tapped",
"data": [
{
"name": "section_name",
"value": "New Restaurants"
},
{
"name": "section_template",
"value": "outlet_4_card"
},
{
"name": "restaurant_id",
"value": "997"
}
]
}
in Android:
HashMap<String, Object> map = new HashMap<>();
for (int i = 0; i < dataList.size(); i++) {
String name = data.get(i).getName();
String value = data.get(i).getValue();
map.put(name, value);
}
clevertapDefaultInstance.pushEvent(event_name, map);
in iOS:
let props = [
"section_name": "New Restaurants",
"section_template": "outlet_4_card",
"restaurant_name": "Cafe Claire",
.....
] as [String : Any]
CleverTap.sharedInstance()?.recordEvent(event_name, withProps: props)
Hybrid Event: onGooglePushEvent Response:
{
"event_name": "Homepage Section Tapped",
"data": {
"section_name": "New Restaurants",
"section_template": "outlet_4_card"
}
}
in Android will be like this:
Bundle bundle = new Bundle();
bundle.putString("section_name", "New Restaurants");
bundle.putString("section_template", "outlet_4_card");
.....
mFirebaseAnalytics.logEvent(event_name, bundle);
in iOS will be like this:
var productDetails: [String: Any] = [
"section_name": "New Restaurants",
"section_template": "outlet_4_card",
......
]
// Log event
Analytics.logEvent(event_name, parameters: productDetails)