Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
997 lines (976 sloc) 51.1 KB
<?xml version="1.0" encoding="utf-8" ?>
<Suite Title="Facebook Ads" RequireVersion="8.1" Id="FacebookAds" Category="Ads" SourceUrl="https://github.com/nielsbosma/SeoTools-for-Excel-Connectors/blob/master/FacebookAds.xml" HelpUrl="http://seotoolsforexcel.com/Facebook-ads/" HelpText="Documentation">
<Author Name="Victor" Url="http://community.seotoolsforexcel.com/users/diskborste/activity"/>
<BrowserAuthenticator AuthUrl="https://www.facebook.com/v3.1/dialog/oauth?client_id=658289924351209&amp;response_type=token&amp;scope=ads_read&amp;redirect_uri=https://www.facebook.com/connect/login_success.html" StayAuthenticated="false" QueryParameter="access_token"/>
<Resources>
<Resource Id="Sortings">
<Item Id="impressions" Title="Impressions"/>
<Item Id="date_start" Title="Date Start"/>
<Item Id="date_stop" Title="Date Stop"/>
<Item Id="reach" Title="Reach"/>
<Item Id="spend" Title="Spent"/>
<Item Id="clicks" Title="Clicks"/>
<Item Id="website_clicks" Title="Website Clicks"/>
<Item Id="app_store_clicks" Title="App Store Clicks"/>
<Item Id="social_impressions" Title="Social Impressions"/>
<Item Id="social_reach" Title="Social Reach"/>
<Item Id="social_clicks" Title="Social Clicks"/>
<Item Id="total_actions" Title="Actions"/>
<Item Id="cost_per_total_action" Title="Cost per Action"/>
<Item Id="cpc" Title="CPC"/>
<Item Id="frequency" Title="Frequency"/>
</Resource>
<Resource Id="FrequencySortings">
<Item Id="reach" Title="Reach"/>
<Item Id="frequency_value" Title="Frequency"/>
</Resource>
<Resource Id="Type">
<Item Id="impression_device" Title="Device"/>
<Item Id="age" Title="Age"/>
<Item Id="gender" Title="Gender"/>
<Item Id="gender,age" Title="Gender/Age"/>
<Item Id="country" Title="Country"/>
<Item Id="region" Title="Region"/>
<Item Id="placement" Title="Placement"/>
<Item Id="publisher_platform" Title="Publisher Platform"/>
</Resource>
<Resource Id="TimeIncrements">
<Item Id="all_days" Title="All Days"/>
<Item Id="1" Title="Daily"/>
<Item Id="7" Title="Weekly"/>
<Item Id="14" Title="2 Weeks"/>
<Item Id="monthly" Title="Monthly"/>
</Resource>
</Resources>
<RestConnector Id="ListAccounts" Title="List Accounts" Hidden="false">
<Paging PageSize="25">
<Parse>
<JsonPath Id="NextResults" Expr="paging.cursors.after"/>
</Parse>
</Paging>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/me/adaccounts?
fields=name,account_id,balance,account_status
&access_token=@(Model.Authenticator.Token)
&limit=@(Model.PageCursor.NextTake)
@if(Model.PageCursor.Page != 0)
{
@: &after=@Model.NextResults
}
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="account_id" Id="AccountId" Title="Account Id" Converter="String" HelpText="ID of ad account"/>
<JsonPath Expr="name" Id="Name" Title="Name" Converter="String" HelpText="The name of the ad account"/>
<JsonPath Expr="balance" Id="Balance" Title="Balance" Converter="Double" HelpText="Bill amount due"/>
<Compute Id="Category" Title="Category" Converter="String" HelpText="Status of the account">
<Compute.Expr>
<![CDATA[
@if(Model.StatusInput == 1)
{
@: ACTIVE
}
else if(Model.StatusInput == 2)
{
@: DISABLED
}
else if(Model.StatusInput == 3)
{
@: UNSETTLED
}
else if(Model.StatusInput == 7)
{
@: PENDING_RISK_REVIEW
}
else if(Model.StatusInput == 9)
{
@: IN_GRACE_PERIOD
}
else if(Model.StatusInput == 100)
{
@: PENDING_CLOSURE
}
else if(Model.StatusInput == 101)
{
@: CLOSED
}
else if(Model.StatusInput == 102)
{
@: PENDING_SETTLEMENT
}
else if(Model.StatusInput == 201)
{
@: ANY_ACTIVE
}
else if(Model.StatusInput == 202)
{
@: ANY_CLOSED
}
]]>
</Compute.Expr>
<JsonPath Expr="account_status" Id="StatusInput" Converter="Int"/>
</Compute>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="ListAccountsHidden" Hidden="true">
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/me/adaccounts?
fields=name,account_id,balance
&access_token=@(Model.Authenticator.Token)
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="account_id" Id="AccountId" Title="Account Id" Converter="String" HelpText=""/>
<JsonPath Expr="name" Id="Name" Title="Name" Converter="String" HelpText=""/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="ListCampaigns" Title="List Campaigns" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="50872578" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
</Parameters>
<Paging PageSize="25">
<Parse>
<JsonPath Id="NextResults" Expr="paging.cursors.after"/>
</Parse>
</Paging>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/act_@(Model.AccountId)/campaigns?
fields=@SelectedFields()
&access_token=@(Model.Authenticator.Token)
&limit=@(Model.PageCursor.NextTake)
@if(Model.PageCursor.Page != 0)
{
@: &after=@Model.NextResults
}
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="id" Id="CampaignId" Title="Campaign Id" Tag="id" Converter="String" HelpText="Campaign's ID"/>
<JsonPath Expr="name" Id="Name" Title="Name" Tag="name" Converter="String" HelpText="Campaign's name"/>
<JsonPath Expr="effective_status" Id="Status" Title="Status" Tag="effective_status" Converter="String" HelpText="The effective status of this campaign."/>
<JsonPath Expr="created_time" Id="Created" Title="Created" Tag="created_time" Converter="DateTime" HelpText="Created Time"/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="ListCampaignsHidden" Hidden="true">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="50872578" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
</Parameters>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/act_@(Model.AccountId)/campaigns?
fields=@SelectedFields()
&access_token=@(Model.Authenticator.Token)
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="id" Id="CampaignId" Title="Campaign Id" Tag="id" Converter="String" HelpText=""/>
<JsonPath Expr="name" Id="Name" Title="Name" Tag="name" Converter="String" HelpText=""/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="ListAdsets" Title="List Adsets" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="2066084836749681" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
<Text Id="CampaignFilter" Title="Filter by Campaign" DefaultValue="" Required="false" Debug.DefaultValue="" Select.Connector="ListCampaignsHidden" Select.IdField="CampaignId" Select.TitleField="Name"/>
</Parameters>
<Paging PageSize="25">
<Parse>
<JsonPath Id="NextResults" Expr="paging.cursors.after"/>
</Parse>
</Paging>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/
@if(!string.IsNullOrEmpty(Model.CampaignFilter))
{
@(Model.CampaignFilter)
}
else
{
@: act_@(Model.AccountId)
}
/adsets?
fields=@SelectedFields()
&access_token=@(Model.Authenticator.Token)
&limit=@(Model.PageCursor.NextTake)
@if(Model.PageCursor.Page != 0)
{
@: &after=@Model.NextResults
}
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="id" Id="AdsetId" Title="Adset Id" Tag="id" Converter="String" HelpText="Ad set ID"/>
<JsonPath Expr="name" Id="Name" Title="Name" Tag="name" Converter="String" HelpText="Name of ad set"/>
<JsonPath Expr="effective_status" Id="Status" Title="Status" Tag="effective_status" Converter="String" HelpText="The effective status of the ad set, which can be either its own status or caused by its parent campaign."/>
<JsonPath Expr="daily_budget" Id="DailyBudget" Title="Daily Budget" Tag="daily_budget" Converter="Double" HelpText="The daily budget of the set defined in your account currency"/>
<JsonPath Expr="lifetime_budget" Id="Budget" Title="Budget" Tag="lifetime_budget" Converter="Double" HelpText="The lifetime budget of the set defined in your account currency."/>
<JsonPath Expr="budget_remaining" Id="BudgetRemaining" Title="Budget Remaining" Tag="budget_remaining" Converter="Double" HelpText="Remaining budget"/>
<JsonPath Expr="billing_event" Id="BillingEvent" Title="Billing Event" Tag="billing_event" Converter="String" HelpText="The billing event that this adset is using"/>
<JsonPath Expr="created_time" Id="Created" Title="Created" Tag="created_time" Converter="DateTime" HelpText="Created time"/>
<JsonPath Expr="end_time" Id="EndTime" Title="End Time" Tag="end_time" Converter="DateTime" HelpText="End time"/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="ListAdsetsHidden" Hidden="true">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="50872578" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
</Parameters>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/
act_@(Model.AccountId)
/adsets?
fields=id,name
&access_token=@(Model.Authenticator.Token)
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="id" Id="AdsetId" Title="Adset Id" Tag="id" Converter="String" HelpText=""/>
<JsonPath Expr="name" Id="Name" Title="Name" Tag="name" Converter="String" HelpText=""/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="ListAds" Title="List Ads" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="50872578" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
<Text Id="CampaignFilter" Title="Filter by Campaign" DefaultValue="" Required="false" Debug.DefaultValue="" Select.Connector="ListCampaignsHidden" Select.IdField="CampaignId" Select.TitleField="Name"/>
<Text Id="AdsetFilter" Title="Filter by Adset" DefaultValue="" Required="false" Debug.DefaultValue="" Select.Connector="ListAdsetsHidden" Select.IdField="AdsetId" Select.TitleField="Name"/>
</Parameters>
<Paging PageSize="25">
<Parse>
<JsonPath Id="NextResults" Expr="paging.cursors.after"/>
</Parse>
</Paging>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/
@if(!string.IsNullOrEmpty(Model.AdsetFilter))
{
@(Model.AdsetFilter)
}
else if(!string.IsNullOrEmpty(Model.CampaignFilter))
{
@(Model.CampaignFilter)
}
else
{
@: act_@(Model.AccountId)
}
/ads?
fields=@SelectedFields()
&access_token=@(Model.Authenticator.Token)
&limit=@(Model.PageCursor.NextTake)
@if(Model.PageCursor.Page != 0)
{
@: &after=@Model.NextResults
}
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="id" Id="AdId" Title="Ad Id" Tag="id" Converter="String" HelpText="The ID of this ad."/>
<JsonPath Expr="name" Id="Name" Title="Name" Tag="name" Converter="String" HelpText="Name of the ad."/>
<JsonPath Expr="created_time" Id="Created" Title="Created" Tag="created_time" Converter="DateTime" HelpText="Created time"/>
<JsonPath Expr="effective_status" Id="Status" Title="Status" Tag="effective_status" Converter="String" HelpText="The effective status of the ad."/>
<JsonPath Expr="adset.id" Id="AdsetId" Title="Adset Id" Tag="adset" Converter="String" HelpText="The ID of the ad set"/>
<JsonPath Expr="campaign.id" Id="CampaignId" Title="Campaign Id" Tag="campaign" Converter="String" HelpText="ID of the ad campaign that contains this ad"/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="ListAdsHidden" Hidden="true">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="50872578" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
</Parameters>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/act_@(Model.AccountId)
/ads?
fields=id,name
&access_token=@(Model.Authenticator.Token)
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="id" Id="AdId" Title="Ad Id" Tag="id" Converter="String" HelpText=""/>
<JsonPath Expr="name" Id="Name" Title="Name" Tag="name" Converter="String" HelpText=""/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="AccountStatistics" Title="Account Statistics" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="2269577553115017" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
<DateInterval Id="DateInterval" Title="Interval"/>
<Select Id="PeriodIncrement" Title="Breakdown by Period Increment" Required="false" DefaultValue="all_days">
<DataSource>
<Resource Id="TimeIncrements"/>
</DataSource>
</Select>
<Radio Id="Level" Title="Sub level" DefaultValue="none" Required="false">
<DataSource>
<Item Id="none" Title="None"/>
<Item Id="campaign" Title="Campaign"/>
<Item Id="adset" Title="Adset"/>
<Item Id="ad" Title="Ad"/>
</DataSource>
</Radio>
<Select Id="Sort" Title="Sort" Required="false" DefaultValue="impressions">
<DataSource>
<Resource Id="Sortings"/>
</DataSource>
</Select>
<Radio Id="Direction" Title="Direction" DefaultValue="desc" Required="false">
<DataSource>
<Item Id="descending" Title="Descending"/>
<Item Id="ascending" Title="Ascending"/>
</DataSource>
</Radio>
</Parameters>
<Paging PageSize="25">
<Parse>
<JsonPath Id="NextResults" Expr="paging.cursors.after"/>
</Parse>
</Paging>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/act_@(Model.AccountId)/insights?
fields=@SelectedFields()
@if(Model.Level != "none")
{
@: &level=@(Model.Level)
}
&sort=@(Model.Sort)
_
@(Model.Direction)
&time_range[since]=@(Model.DateInterval.StartDate.ToString("yyyy-MM-dd"))
&time_range[until]=@(Model.DateInterval.EndDate.ToString("yyyy-MM-dd"))
&time_increment=@(Model.PeriodIncrement)
&access_token=@(Model.Authenticator.Token)
&limit=@(Model.PageCursor.NextTake)
@if(Model.PageCursor.Page != 0)
{
@: &after=@Model.NextResults
}
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="date_start" Id="DateStart" Title="Date Start" Converter="DateTime" HelpText="The start date for your data."/>
<JsonPath Expr="date_stop" Id="DateStop" Title="Date Stop" Converter="DateTime" HelpText="The end date for your data."/>
<JsonPath Expr="campaign_id" Id="CampaignId" Title="Campaign Id" Converter="String" Tag="campaign_id" HelpText="The unique ID number of the ad campaign" Checked="false" DefaultValue="-"/>
<JsonPath Expr="campaign_name" Id="CampaignName" Title="Campaign Name" Converter="String" Tag="campaign_name" HelpText="The name of the ad campaign" Checked="false" DefaultValue="-"/>
<JsonPath Expr="adset_id" Id="AdsetId" Title="Adset Id" Converter="String" Tag="adset_id" HelpText="The unique ID of the ad set" Checked="false" DefaultValue="-"/>
<JsonPath Expr="adset_name" Id="AdsetName" Title="Adset Name" Converter="String" Tag="adset_name" HelpText="The name of the ad set" Checked="false" DefaultValue="-"/>
<JsonPath Expr="ad_id" Id="AdId" Title="Ad Id" Converter="String" Tag="ad_id" HelpText="The unique ID of the ad" Checked="false" DefaultValue="-"/>
<JsonPath Expr="ad_name" Id="AdName" Title="Ad Name" Converter="String" Tag="ad_name" HelpText="The unique ID of the ad" Checked="false" DefaultValue="-"/>
<JsonPath Expr="impressions" Id="Impressions" Title="Impressions" Converter="Int" Tag="impressions" HelpText="The number of times your ads were viewed."/>
<JsonPath Expr="reach" Id="Reach" Title="Reach" Tag="reach" Converter="Int" HelpText="The number of people who saw your ads at least once."/>
<JsonPath Expr="frequency" Id="Frequency" Title="Frequency" Tag="frequency" Converter="Double" HelpText="The average number of times each person saw your ads."/>
<JsonPath Expr="spend" Id="Spent" Title="Spent" Tag="spend" Converter="Double" HelpText="The total amount of money you've spent on your campaign"/>
<JsonPath Expr="social_spend" Id="SocialSpent" Title="Social Spent" Tag="social_spend" Converter="Double" HelpText="The number of people who saw your ad when displayed with social information, which shows other Facebook friends who engaged with your Facebook Page or ad."/>
<JsonPath Expr="clicks" Id="Clicks" Title="Clicks" Tag="clicks" Converter="Int" HelpText="The total number of clicks on your ad. This may include offsite clicks to your website, Page likes, post comments, event responses or app installs."/>
<JsonPath Expr="unique_clicks" Id="UniqueClicks" Title="Unique Clicks" Tag="unique_clicks" Converter="Int" HelpText="The number of people who performed a click (all). This metric is estimated."/>
<JsonPath Expr="cost_per_unique_click" Id="CostUniqueClicks" Title="Cost per Unique Click" Tag="cost_per_unique_click" Converter="Double" HelpText="The average cost for each unique click (all). This metric is estimated."/>
<JsonPath Expr="cpc" Id="CPC" Title="CPC" Tag="cpc" Converter="Double" HelpText="The average cost for each click (all) attributed to your ads."/>
<JsonPath Expr="cpm" Id="CPM" Title="CPM" Tag="cpm" Converter="Double" HelpText="The average cost for 1,000 impressions."/>
<JsonPath Expr="cpp" Id="CPP" Title="CPP" Tag="cpp" Converter="Double" HelpText="The average cost to reach 1,000 people."/>
<JsonPath Expr="ctr" Id="CTR" Title="CTR" Tag="ctr" Converter="Double" HelpText="The percentage of times people saw your ad and performed a click (all)."/>
<JsonPath Expr="unique_ctr" Id="UniqueCTR" Title="Unique CPC" Tag="unique_ctr" Converter="Double" HelpText="The percentage of people who saw your ad and performed a unique click (all)."/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="CampaignStatistics" Title="Campaign Statistics" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="2269577553115017" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
<DateInterval Id="DateInterval" Title="Interval"/>
<Select Id="PeriodIncrement" Title="Breakdown by Period Increment" Required="false" DefaultValue="all_days">
<DataSource>
<Resource Id="TimeIncrements"/>
</DataSource>
</Select>
<Text Id="CampaignId" Title="Filter by Campaign Id" DefaultValue="" Required="false" Debug.DefaultValue="" Select.Connector="ListCampaignsHidden" Select.IdField="CampaignId" Select.TitleField="Name"/>
<Radio Id="Level" Title="Sub level for filtered campaign" DefaultValue="none" Required="false">
<DataSource>
<Item Id="none" Title="None"/>
<Item Id="adset" Title="Adset"/>
<Item Id="ad" Title="Ad"/>
</DataSource>
</Radio>
<Select Id="Sort" Title="Sort" Required="true" DefaultValue="impressions">
<DataSource>
<Resource Id="Sortings"/>
</DataSource>
</Select>
<Radio Id="Direction" Title="Direction" DefaultValue="desc" Required="true">
<DataSource>
<Item Id="descending" Title="Descending"/>
<Item Id="ascending" Title="Ascending"/>
</DataSource>
</Radio>
</Parameters>
<Paging PageSize="25">
<Parse>
<JsonPath Id="NextResults" Expr="paging.cursors.after"/>
</Parse>
</Paging>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/
@if(!string.IsNullOrEmpty(Model.CampaignId))
{
@(Model.CampaignId)
@: /insights?
}
else
{
@: act_@(Model.AccountId)
@: /insights?level=campaign
}
&fields=@SelectedFields()
@if(Model.Level != "none")
{
@: &level=@(Model.Level)
}
&sort=@(Model.Sort)
_
@(Model.Direction)
&time_range[since]=@(Model.DateInterval.StartDate.ToString("yyyy-MM-dd"))
&time_range[until]=@(Model.DateInterval.EndDate.ToString("yyyy-MM-dd"))
&time_increment=@(Model.PeriodIncrement)
&access_token=@(Model.Authenticator.Token)
&limit=@(Model.PageCursor.NextTake)
@if(Model.PageCursor.Page != 0)
{
@: &after=@Model.NextResults
}
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="date_start" Id="DateStart" Title="Date Start" Converter="DateTime" HelpText="The start date for your data."/>
<JsonPath Expr="date_stop" Id="DateStop" Title="Date Stop" Converter="DateTime" HelpText="The end date for your data."/>
<JsonPath Expr="campaign_id" Id="CampaignId" Title="Campaign Id" Converter="String" Tag="campaign_id" HelpText="The unique ID number of the ad campaign" Checked="false" DefaultValue="-"/>
<JsonPath Expr="campaign_name" Id="CampaignName" Title="Campaign Name" Converter="String" Tag="campaign_name" HelpText="The name of the ad campaign" Checked="false" DefaultValue="-"/>
<JsonPath Expr="adset_id" Id="AdsetId" Title="Adset Id" Converter="String" Tag="adset_id" HelpText="The unique ID of the ad set" Checked="false" DefaultValue="-"/>
<JsonPath Expr="adset_name" Id="AdsetName" Title="Adset Name" Converter="String" Tag="adset_name" HelpText="The name of the ad set" Checked="false" DefaultValue="-"/>
<JsonPath Expr="ad_id" Id="AdId" Title="Ad Id" Converter="String" Tag="ad_id" HelpText="The unique ID of the ad" Checked="false" DefaultValue="-"/>
<JsonPath Expr="ad_name" Id="AdName" Title="Ad Name" Converter="String" Tag="ad_name" HelpText="The unique ID of the ad" Checked="false" DefaultValue="-"/>
<JsonPath Expr="impressions" Id="Impressions" Title="Impressions" Converter="Int" Tag="impressions" HelpText="The number of times your ads were viewed."/>
<JsonPath Expr="reach" Id="Reach" Title="Reach" Tag="reach" Converter="Int" HelpText="The number of people who saw your ads at least once."/>
<JsonPath Expr="frequency" Id="Frequency" Title="Frequency" Tag="frequency" Converter="Double" HelpText="The average number of times each person saw your ads."/>
<JsonPath Expr="spend" Id="Spent" Title="Spent" Tag="spend" Converter="Double" HelpText="The total amount of money you've spent on your campaign"/>
<JsonPath Expr="social_spend" Id="SocialSpent" Title="Social Spent" Tag="social_spend" Converter="Double" HelpText="The number of people who saw your ad when displayed with social information, which shows other Facebook friends who engaged with your Facebook Page or ad."/>
<JsonPath Expr="clicks" Id="Clicks" Title="Clicks" Tag="clicks" Converter="Int" HelpText="The total number of clicks on your ad. This may include offsite clicks to your website, Page likes, post comments, event responses or app installs."/>
<JsonPath Expr="unique_clicks" Id="UniqueClicks" Title="Unique Clicks" Tag="unique_clicks" Converter="Int" HelpText="The number of people who performed a click (all). This metric is estimated."/>
<JsonPath Expr="cost_per_unique_click" Id="CostUniqueClicks" Title="Cost per Unique Click" Tag="cost_per_unique_click" Converter="Double" HelpText="The average cost for each unique click (all). This metric is estimated."/>
<JsonPath Expr="cpc" Id="CPC" Title="CPC" Tag="cpc" Converter="Double" HelpText="The average cost for each click (all) attributed to your ads."/>
<JsonPath Expr="cpm" Id="CPM" Title="CPM" Tag="cpm" Converter="Double" HelpText="The average cost for 1,000 impressions."/>
<JsonPath Expr="cpp" Id="CPP" Title="CPP" Tag="cpp" Converter="Double" HelpText="The average cost to reach 1,000 people."/>
<JsonPath Expr="ctr" Id="CTR" Title="CTR" Tag="ctr" Converter="Double" HelpText="The percentage of times people saw your ad and performed a click (all)."/>
<JsonPath Expr="unique_ctr" Id="UniqueCTR" Title="Unique CPC" Tag="unique_ctr" Converter="Double" HelpText="The percentage of people who saw your ad and performed a unique click (all)."/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="AdsetStatistics" Title="Adset Statistics" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="2269577553115017" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
<DateInterval Id="DateInterval" Title="Interval"/>
<Select Id="PeriodIncrement" Title="Breakdown by Period Increment" Required="false" DefaultValue="all_days">
<DataSource>
<Resource Id="TimeIncrements"/>
</DataSource>
</Select>
<Text Id="AdsetId" Title="Filter by Adset Id" DefaultValue="" Required="false" Debug.DefaultValue="" Select.Connector="ListAdsetsHidden" Select.IdField="AdsetId" Select.TitleField="Name"/>
<Radio Id="Level" Title="Sub level for filtered campaign" DefaultValue="none" Required="false">
<DataSource>
<Item Id="none" Title="None"/>
<Item Id="ad" Title="Ad"/>
</DataSource>
</Radio>
<Select Id="Sort" Title="Sort" Required="true" DefaultValue="impressions">
<DataSource>
<Resource Id="Sortings"/>
</DataSource>
</Select>
<Radio Id="Direction" Title="Direction" DefaultValue="desc" Required="true">
<DataSource>
<Item Id="descending" Title="Descending"/>
<Item Id="ascending" Title="Ascending"/>
</DataSource>
</Radio>
</Parameters>
<Paging PageSize="25">
<Parse>
<JsonPath Id="NextResults" Expr="paging.cursors.after"/>
</Parse>
</Paging>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/
@if(!string.IsNullOrEmpty(Model.AdsetId))
{
@(Model.AdsetId)
@: /insights?
}
else
{
@: act_@(Model.AccountId)
@: /insights?level=adset
}
&fields=@SelectedFields()
@if(Model.Level != "none")
{
@: &level=@(Model.Level)
}
&sort=@(Model.Sort)
_
@(Model.Direction)
&time_range[since]=@(Model.DateInterval.StartDate.ToString("yyyy-MM-dd"))
&time_range[until]=@(Model.DateInterval.EndDate.ToString("yyyy-MM-dd"))
&time_increment=@(Model.PeriodIncrement)
&access_token=@(Model.Authenticator.Token)
&limit=@(Model.PageCursor.NextTake)
@if(Model.PageCursor.Page != 0)
{
@: &after=@Model.NextResults
}
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="date_start" Id="DateStart" Title="Date Start" Converter="DateTime" HelpText="The start date for your data."/>
<JsonPath Expr="date_stop" Id="DateStop" Title="Date Stop" Converter="DateTime" HelpText="The end date for your data."/>
<JsonPath Expr="campaign_id" Id="CampaignId" Title="Campaign Id" Converter="String" Tag="campaign_id" HelpText="The unique ID number of the ad campaign" Checked="false" DefaultValue="-"/>
<JsonPath Expr="campaign_name" Id="CampaignName" Title="Campaign Name" Converter="String" Tag="campaign_name" HelpText="The name of the ad campaign" Checked="false" DefaultValue="-"/>
<JsonPath Expr="adset_id" Id="AdsetId" Title="Adset Id" Converter="String" Tag="adset_id" HelpText="The unique ID of the ad set" Checked="false" DefaultValue="-"/>
<JsonPath Expr="adset_name" Id="AdsetName" Title="Adset Name" Converter="String" Tag="adset_name" HelpText="The name of the ad set" Checked="false" DefaultValue="-"/>
<JsonPath Expr="ad_id" Id="AdId" Title="Ad Id" Converter="String" Tag="ad_id" HelpText="The unique ID of the ad" Checked="false" DefaultValue="-"/>
<JsonPath Expr="ad_name" Id="AdName" Title="Ad Name" Converter="String" Tag="ad_name" HelpText="The unique ID of the ad" Checked="false" DefaultValue="-"/>
<JsonPath Expr="impressions" Id="Impressions" Title="Impressions" Converter="Int" Tag="impressions" HelpText="The number of times your ads were viewed."/>
<JsonPath Expr="reach" Id="Reach" Title="Reach" Tag="reach" Converter="Int" HelpText="The number of people who saw your ads at least once."/>
<JsonPath Expr="frequency" Id="Frequency" Title="Frequency" Tag="frequency" Converter="Double" HelpText="The average number of times each person saw your ads."/>
<JsonPath Expr="spend" Id="Spent" Title="Spent" Tag="spend" Converter="Double" HelpText="The total amount of money you've spent on your campaign"/>
<JsonPath Expr="social_spend" Id="SocialSpent" Title="Social Spent" Tag="social_spend" Converter="Double" HelpText="The number of people who saw your ad when displayed with social information, which shows other Facebook friends who engaged with your Facebook Page or ad."/>
<JsonPath Expr="clicks" Id="Clicks" Title="Clicks" Tag="clicks" Converter="Int" HelpText="The total number of clicks on your ad. This may include offsite clicks to your website, Page likes, post comments, event responses or app installs."/>
<JsonPath Expr="unique_clicks" Id="UniqueClicks" Title="Unique Clicks" Tag="unique_clicks" Converter="Int" HelpText="The number of people who performed a click (all). This metric is estimated."/>
<JsonPath Expr="cost_per_unique_click" Id="CostUniqueClicks" Title="Cost per Unique Click" Tag="cost_per_unique_click" Converter="Double" HelpText="The average cost for each unique click (all). This metric is estimated."/>
<JsonPath Expr="cpc" Id="CPC" Title="CPC" Tag="cpc" Converter="Double" HelpText="The average cost for each click (all) attributed to your ads."/>
<JsonPath Expr="cpm" Id="CPM" Title="CPM" Tag="cpm" Converter="Double" HelpText="The average cost for 1,000 impressions."/>
<JsonPath Expr="cpp" Id="CPP" Title="CPP" Tag="cpp" Converter="Double" HelpText="The average cost to reach 1,000 people."/>
<JsonPath Expr="ctr" Id="CTR" Title="CTR" Tag="ctr" Converter="Double" HelpText="The percentage of times people saw your ad and performed a click (all)."/>
<JsonPath Expr="unique_ctr" Id="UniqueCTR" Title="Unique CPC" Tag="unique_ctr" Converter="Double" HelpText="The percentage of people who saw your ad and performed a unique click (all)."/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="AdStatistics" Title="Ad Statistics" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="2269577553115017" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
<DateInterval Id="DateInterval" Title="Interval"/>
<Select Id="PeriodIncrement" Title="Breakdown by Period Increment" Required="false" DefaultValue="all_days">
<DataSource>
<Resource Id="TimeIncrements"/>
</DataSource>
</Select>
<Text Id="AdId" Title="Filter by Ad Id" DefaultValue="" Required="false" Debug.DefaultValue="" Select.Connector="ListAdsHidden" Select.IdField="AdId" Select.TitleField="Name"/>
<Select Id="Sort" Title="Sort" Required="true" DefaultValue="impressions">
<DataSource>
<Resource Id="Sortings"/>
</DataSource>
</Select>
<Radio Id="Direction" Title="Direction" DefaultValue="desc" Required="true">
<DataSource>
<Item Id="descending" Title="Descending"/>
<Item Id="ascending" Title="Ascending"/>
</DataSource>
</Radio>
</Parameters>
<Paging PageSize="25">
<Parse>
<JsonPath Id="NextResults" Expr="paging.cursors.after"/>
</Parse>
</Paging>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/
@if(!string.IsNullOrEmpty(Model.AdId))
{
@(Model.AdId)
@: /insights?
}
else
{
@: act_@(Model.AccountId)
@: /insights?level=ad
}
&fields=@SelectedFields()
&sort=@(Model.Sort)
_
@(Model.Direction)
&time_range[since]=@(Model.DateInterval.StartDate.ToString("yyyy-MM-dd"))
&time_range[until]=@(Model.DateInterval.EndDate.ToString("yyyy-MM-dd"))
&time_increment=@(Model.PeriodIncrement)
&access_token=@(Model.Authenticator.Token)
&limit=@(Model.PageCursor.NextTake)
@if(Model.PageCursor.Page != 0)
{
@: &after=@Model.NextResults
}
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="date_start" Id="DateStart" Title="Date Start" Converter="DateTime" HelpText="The start date for your data."/>
<JsonPath Expr="date_stop" Id="DateStop" Title="Date Stop" Converter="DateTime" HelpText="The end date for your data."/>
<JsonPath Expr="campaign_id" Id="CampaignId" Title="Campaign Id" Converter="String" Tag="campaign_id" HelpText="The unique ID number of the ad campaign" Checked="false" DefaultValue="-"/>
<JsonPath Expr="campaign_name" Id="CampaignName" Title="Campaign Name" Converter="String" Tag="campaign_name" HelpText="The name of the ad campaign" Checked="false" DefaultValue="-"/>
<JsonPath Expr="adset_id" Id="AdsetId" Title="Adset Id" Converter="String" Tag="adset_id" HelpText="The unique ID of the ad set" Checked="false" DefaultValue="-"/>
<JsonPath Expr="adset_name" Id="AdsetName" Title="Adset Name" Converter="String" Tag="adset_name" HelpText="The name of the ad set" Checked="false" DefaultValue="-"/>
<JsonPath Expr="ad_id" Id="AdId" Title="Ad Id" Converter="String" Tag="ad_id" HelpText="The unique ID of the ad" Checked="false" DefaultValue="-"/>
<JsonPath Expr="ad_name" Id="AdName" Title="Ad Name" Converter="String" Tag="ad_name" HelpText="The unique ID of the ad" Checked="false" DefaultValue="-"/>
<JsonPath Expr="impressions" Id="Impressions" Title="Impressions" Converter="Int" Tag="impressions" HelpText="The number of times your ads were viewed."/>
<JsonPath Expr="reach" Id="Reach" Title="Reach" Tag="reach" Converter="Int" HelpText="The number of people who saw your ads at least once."/>
<JsonPath Expr="frequency" Id="Frequency" Title="Frequency" Tag="frequency" Converter="Double" HelpText="The average number of times each person saw your ads."/>
<JsonPath Expr="spend" Id="Spent" Title="Spent" Tag="spend" Converter="Double" HelpText="The total amount of money you've spent on your campaign"/>
<JsonPath Expr="social_spend" Id="SocialSpent" Title="Social Spent" Tag="social_spend" Converter="Double" HelpText="The number of people who saw your ad when displayed with social information, which shows other Facebook friends who engaged with your Facebook Page or ad."/>
<JsonPath Expr="clicks" Id="Clicks" Title="Clicks" Tag="clicks" Converter="Int" HelpText="The total number of clicks on your ad. This may include offsite clicks to your website, Page likes, post comments, event responses or app installs."/>
<JsonPath Expr="unique_clicks" Id="UniqueClicks" Title="Unique Clicks" Tag="unique_clicks" Converter="Int" HelpText="The number of people who performed a click (all). This metric is estimated."/>
<JsonPath Expr="cost_per_unique_click" Id="CostUniqueClicks" Title="Cost per Unique Click" Tag="cost_per_unique_click" Converter="Double" HelpText="The average cost for each unique click (all). This metric is estimated."/>
<JsonPath Expr="cpc" Id="CPC" Title="CPC" Tag="cpc" Converter="Double" HelpText="The average cost for each click (all) attributed to your ads."/>
<JsonPath Expr="cpm" Id="CPM" Title="CPM" Tag="cpm" Converter="Double" HelpText="The average cost for 1,000 impressions."/>
<JsonPath Expr="cpp" Id="CPP" Title="CPP" Tag="cpp" Converter="Double" HelpText="The average cost to reach 1,000 people."/>
<JsonPath Expr="ctr" Id="CTR" Title="CTR" Tag="ctr" Converter="Double" HelpText="The percentage of times people saw your ad and performed a click (all)."/>
<JsonPath Expr="unique_ctr" Id="UniqueCTR" Title="Unique CPC" Tag="unique_ctr" Converter="Double" HelpText="The percentage of people who saw your ad and performed a unique click (all)."/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="StatisticsBreakdown" Title="Statistics Breakdown" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="50872578" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
<Text Id="SubItemFilter" Title="Filter by Id (Campaign, Adset, or Ad)" DefaultValue="" Required="false" Debug.DefaultValue=""/>
<Select Id="Type" Title="Select Method or Demography" Required="false" DefaultValue="impression_device">
<DataSource>
<Resource Id="Type"/>
</DataSource>
</Select>
<DateInterval Id="DateInterval" Title="Interval"/>
<Select Id="PeriodIncrement" Title="Breakdown by Period Increment" Required="false" DefaultValue="all_days">
<DataSource>
<Resource Id="TimeIncrements"/>
</DataSource>
</Select>
<Select Id="Sort" Title="Sort" Required="true" DefaultValue="impressions">
<DataSource>
<Resource Id="Sortings"/>
</DataSource>
</Select>
<Radio Id="Direction" Title="Direction" DefaultValue="desc" Required="true">
<DataSource>
<Item Id="descending" Title="Descending"/>
<Item Id="ascending" Title="Ascending"/>
</DataSource>
</Radio>
</Parameters>
<Paging PageSize="25">
<Parse>
<JsonPath Id="NextResults" Expr="paging.cursors.after"/>
</Parse>
</Paging>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/
@if(string.IsNullOrEmpty(Model.SubItemFilter))
{
@: act_@(Model.AccountId)
}
else
{
@(Model.SubItemFilter)
}
/insights?
fields=@SelectedFields()
&breakdowns=@(Model.Type)
&sort=@(Model.Sort)
_
@(Model.Direction)
&time_range[since]=@(Model.DateInterval.StartDate.ToString("yyyy-MM-dd"))
&time_range[until]=@(Model.DateInterval.EndDate.ToString("yyyy-MM-dd"))
&time_increment=@(Model.PeriodIncrement)
&access_token=@(Model.Authenticator.Token)
&limit=@(Model.PageCursor.NextTake)
@if(Model.PageCursor.Page != 0)
{
@: &after=@Model.NextResults
}
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="date_start" Id="DateStart" Title="Date Start" Converter="DateTime" HelpText="The start date for your data."/>
<JsonPath Expr="date_stop" Id="DateStop" Title="Date Stop" Converter="DateTime" HelpText="The end date for your data."/>
<Compute Id="Category" Title="Category" HelpText="Category Breakdown.">
<Compute.Expr>
<![CDATA[
@if(Model.Type == "gender,age")
{
@(Model.Gender) @: - @(Model.AgeGroup)
}
else
{
@(Model.Category)
}
]]>
</Compute.Expr>
<JsonPath Expr="gender" Id="Gender" Converter="String"/>
<JsonPath Expr="age" Id="AgeGroup" Converter="String"/>
<JsonPath Expr="@(Model.Type)" Id="Category" Converter="String"/>
</Compute>
<JsonPath Expr="impressions" Id="Impressions" Title="Impressions" Converter="Int" Tag="impressions" HelpText="The number of times your ads were viewed."/>
<JsonPath Expr="reach" Id="Reach" Title="Reach" Tag="reach" Converter="Int" HelpText="The number of people who saw your ads at least once."/>
<JsonPath Expr="frequency" Id="Frequency" Title="Frequency" Tag="frequency" Converter="Double" HelpText="The average number of times each person saw your ads."/>
<JsonPath Expr="spend" Id="Spent" Title="Spent" Tag="spend" Converter="Double" HelpText="The total amount of money you've spent on your campaign"/>
<JsonPath Expr="clicks" Id="Clicks" Title="Clicks" Tag="clicks" Converter="Int" HelpText="The total number of clicks on your ad. This may include offsite clicks to your website, Page likes, post comments, event responses or app installs."/>
<JsonPath Expr="unique_clicks" Id="UniqueClicks" Title="Unique Clicks" Tag="unique_clicks" Converter="Int" HelpText="The number of people who performed a click (all). This metric is estimated."/>
<JsonPath Expr="cost_per_unique_click" Id="CostUniqueClicks" Title="Cost per Unique Click" Tag="cost_per_unique_click" Converter="Double" HelpText="The average cost for each unique click (all). This metric is estimated."/>
<JsonPath Expr="cpc" Id="CPC" Title="CPC" Tag="cpc" Converter="Double" HelpText="The average cost for each click (all) attributed to your ads."/>
<JsonPath Expr="cpm" Id="CPM" Title="CPM" Tag="cpm" Converter="Double" HelpText="The average cost for 1,000 impressions."/>
<JsonPath Expr="cpp" Id="CPP" Title="CPP" Tag="cpp" Converter="Double" HelpText="The average cost to reach 1,000 people."/>
<JsonPath Expr="ctr" Id="CTR" Title="CTR" Tag="ctr" Converter="Double" HelpText="The percentage of times people saw your ad and performed a click (all)."/>
<JsonPath Expr="unique_ctr" Id="UniqueCTR" Title="Unique CPC" Tag="unique_ctr" Converter="Double" HelpText="The percentage of people who saw your ad and performed a unique click (all)."/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="ReachFrequency" Title="Reach Frequency" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="50872578" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
<Text Id="SubItemFilter" Title="Filter by Id (Campaign, Adset, or Ad)" DefaultValue="" Required="false" Debug.DefaultValue=""/>
<DateInterval Id="DateInterval" Title="Interval"/>
<Select Id="Sort" Title="Sort" Required="true" DefaultValue="reach">
<DataSource>
<Resource Id="FrequencySortings"/>
</DataSource>
</Select>
<Radio Id="Direction" Title="Direction" DefaultValue="desc" Required="true">
<DataSource>
<Item Id="descending" Title="Descending"/>
<Item Id="ascending" Title="Ascending"/>
</DataSource>
</Radio>
</Parameters>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/
@if(string.IsNullOrEmpty(Model.SubItemFilter))
{
@: act_@(Model.AccountId)
}
else
{
@(Model.SubItemFilter)
}
/insights?
fields=reach
&breakdowns=frequency_value
&sort=@(Model.Sort)
_
@(Model.Direction)
&time_range[since]=@(Model.DateInterval.StartDate.ToString("yyyy-MM-dd"))
&time_range[until]=@(Model.DateInterval.EndDate.ToString("yyyy-MM-dd"))
&access_token=@(Model.Authenticator.Token)
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="data.*">
<JsonPath Expr="date_start" Id="DateStart" Title="Date Start" Converter="DateTime" HelpText="The start date for your data."/>
<JsonPath Expr="date_stop" Id="DateStop" Title="Date Stop" Converter="DateTime" HelpText="The end date for your data."/>
<JsonPath Expr="frequency_value" Id="Frequency" Title="Frequency" Converter="String" HelpText="How often a given person in your target audience has seen your content."/>
<JsonPath Expr="reach" Id="Reach" Title="Reach" Converter="Int" HelpText="The number of people who saw your ads at least once. Reach is different from impressions, which may include multiple views of your ads by the same people."/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="ActionsBreakdown" Title="Actions Breakdown" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="2066084836749681" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
<Text Id="SubItemFilter" Title="Filter by Id (Campaign, Adset, or Ad)" DefaultValue="" Required="false" Debug.DefaultValue=""/>
<Text Id="ActionFilter" Title="Filter by Action" DefaultValue="" Required="false" Debug.DefaultValue=""/>
<DateInterval Id="DateInterval" Title="Interval"/>
<Radio Id="Unique" Title="Action Type" DefaultValue="actions" Required="true">
<DataSource>
<Item Id="actions" Title="Total"/>
<Item Id="unique_actions" Title="Unique"/>
</DataSource>
</Radio>
</Parameters>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/
@if(string.IsNullOrEmpty(Model.SubItemFilter))
{
@: act_@(Model.AccountId)
}
else
{
@(Model.SubItemFilter)
}
/insights?
fields=@(Model.Unique)
&access_token=@(Model.Authenticator.Token)
&time_range[since]=@(Model.DateInterval.StartDate.ToString("yyyy-MM-dd"))
&time_range[until]=@(Model.DateInterval.EndDate.ToString("yyyy-MM-dd"))
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="$..@(Model.Unique)@(ReturnActionFilter())">
<JsonPath Expr="action_type" Id="Type" Title="Type" Converter="String" HelpText="Action type"/>
<JsonPath Expr="value" Id="Actions" Title="Actions" Converter="Int" HelpText="Number of actions"/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RestConnector Id="ActionsBreakdownCost" Title="Actions Breakdown by Cost" Hidden="false">
<Parameters>
<Text Id="AccountId" Title="Account Id" DefaultValue="" Required="true" Debug.DefaultValue="2066084836749681" Select.Connector="ListAccountsHidden" Select.IdField="AccountId" Select.TitleField="Name"/>
<Text Id="SubItemFilter" Title="Filter by Id (Campaign, Adset, or Ad)" DefaultValue="" Required="false" Debug.DefaultValue=""/>
<Text Id="ActionFilter" Title="Filter by Action" DefaultValue="" Required="false" Debug.DefaultValue=""/>
<DateInterval Id="DateInterval" Title="Interval"/>
<Radio Id="Unique" Title="Action Type" DefaultValue="actions" Required="true">
<DataSource>
<Item Id="cost_per_action_type" Title="Total"/>
<Item Id="cost_per_unique_action_type" Title="Unique"/>
</DataSource>
</Radio>
</Parameters>
<Fetch>
<Fetch.Url>
<![CDATA[
https://graph.facebook.com/v3.2/
@if(string.IsNullOrEmpty(Model.SubItemFilter))
{
@: act_@(Model.AccountId)
}
else
{
@(Model.SubItemFilter)
}
/insights?
fields=@(Model.Unique)
&access_token=@(Model.Authenticator.Token)
&time_range[since]=@(Model.DateInterval.StartDate.ToString("yyyy-MM-dd"))
&time_range[until]=@(Model.DateInterval.EndDate.ToString("yyyy-MM-dd"))
]]>
</Fetch.Url>
</Fetch>
<Parse>
<JsonPath Expr="$..@(Model.Unique)@(ReturnActionFilter())">
<JsonPath Expr="action_type" Id="Type" Title="Type" Converter="String" HelpText="Action type"/>
<JsonPath Expr="value" Id="Actions" Title="Actions" Converter="Int" HelpText="Number of actions"/>
</JsonPath>
</Parse>
<Fail>
<JsonPath Expr="$.error.message"/>
</Fail>
</RestConnector>
<RazorFunctions>
<![CDATA[
string SelectedFields() {
string[] fields = ((string)Model.Fields).Split(',').Select(e => e.Trim().ToLower()).ToArray();
return string.Join(",",((ResultField[])Model.Headers).Where(e => !string.IsNullOrEmpty(e.Tag) && fields.Contains(e.Identifier.ToLower())).Select(e => e.Tag).ToArray());
}
string ReturnActionFilter() {
if(!string.IsNullOrEmpty(Model.ActionFilter))
{
return "[?(@@.action_type=='" + Model.ActionFilter + "')]";
}
else
{
return ".*";
}
}
]]>
</RazorFunctions>
</Suite>
You can’t perform that action at this time.