Skip to content

Commit

Permalink
Facebook deprecated page_engaged_users metric
Browse files Browse the repository at this point in the history
  • Loading branch information
lao9s committed Apr 5, 2024
1 parent 99f6ed6 commit 15e887c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion resources/js/Components/Dropdown/DropdownItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defineProps({
}
});
const classes = 'flex items-center p-sm w-full rounded-md text-gray-800 hover:bg-gray-100 transition ease-in-out duration-200';
const classes = 'flex items-center p-sm w-full first:rounded-t-md last:rounded-b-md text-gray-800 hover:bg-gray-100 transition ease-in-out duration-200';
const iconClass = 'mr-xs';
</script>
<template>
Expand Down
13 changes: 7 additions & 6 deletions resources/js/Components/Report/FacebookPageReports.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ const getAudienceData = (value) => {
</script>
<template>
<div class="row-px mt-2xl">
<div class="grid grid-cols-1 md:grid-cols-3 gap-sm">
<Panel>
<template #title><span v-tooltip="'The number of people who engaged with your Page. Engagement includes any click.'">Page Engaged Users</span>
</template>
<div class="font-bold text-indigo-500 text-2xl">{{ getMetricCount('page_engaged_users') }}</div>
</Panel>
<div class="grid grid-cols-1 md:grid-cols-2 gap-sm">
<!-- Facebook deprecated `page_engaged_users` metric-->
<!-- <Panel>-->
<!-- <template #title><span v-tooltip="'The number of people who engaged with your Page. Engagement includes any click.'">Page Engaged Users</span>-->
<!-- </template>-->
<!-- <div class="font-bold text-indigo-500 text-2xl">{{ getMetricCount('page_engaged_users') }}</div>-->
<!-- </Panel>-->

<Panel>
<template #title><span v-tooltip="'The number of times people have engaged with your posts through reactions, comments, shares and more.'">Post Engagements</span>
Expand Down
2 changes: 1 addition & 1 deletion src/Reports/FacebookPageReports.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function metrics(Account $account, string $period): array
->get();

return [
'page_engaged_users' => $reports->where('type', FacebookInsightType::PAGE_ENGAGED_USERS)->value('total', 0),
// 'page_engaged_users' => $reports->where('type', FacebookInsightType::PAGE_ENGAGED_USERS)->value('total', 0), Facebook deprecated `page_engaged_users` metric
'page_post_engagements' => $reports->where('type', FacebookInsightType::PAGE_POST_ENGAGEMENTS)->value('total', 0),
'page_posts_impressions' => $reports->where('type', FacebookInsightType::PAGE_POSTS_IMPRESSIONS)->value('total', 0)
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function getPageInsights(): SocialProviderResponse
{
$data = [
'access_token' => $this->getAccessToken()['page_access_token'],
'metric' => 'page_engaged_users,page_post_engagements,page_posts_impressions',
'metric' => 'page_post_engagements,page_posts_impressions', // facebook deprecated `page_engaged_users` metric
'period' => 'day',
'since' => Carbon::today('UTC')->subDays(90)->toDateString(),
'until' => Carbon::today('UTC')->toDateString(),
Expand Down

0 comments on commit 15e887c

Please sign in to comment.