Columns
2 years ago
Groups
2 years ago
Table.php
2 years ago
Table_Campaigns.php
2 years ago
Table_Devices.php
2 years ago
Table_Geo.php
2 years ago
Table_Pages.php
2 years ago
Table_Referrers.php
2 years ago
Table_Campaigns.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP_SCOPED\IAWP\Tables; |
| 4 | |
| 5 | use IAWP_SCOPED\IAWP\Rows\Campaigns; |
| 6 | use IAWP_SCOPED\IAWP\Statistics\Campaign_Statistics; |
| 7 | use IAWP_SCOPED\IAWP\Tables\Columns\Column; |
| 8 | use IAWP_SCOPED\IAWP\Tables\Groups\Group; |
| 9 | use IAWP_SCOPED\IAWP\Tables\Groups\Groups; |
| 10 | /** @internal */ |
| 11 | class Table_Campaigns extends Table |
| 12 | { |
| 13 | protected function table_name() : string |
| 14 | { |
| 15 | return 'campaigns'; |
| 16 | } |
| 17 | protected function groups() : Groups |
| 18 | { |
| 19 | $groups = []; |
| 20 | $groups[] = new Group('campaign', \__('Campaign', 'independent-analytics'), Campaigns::class, Campaign_Statistics::class); |
| 21 | return new Groups($groups); |
| 22 | } |
| 23 | protected function local_columns() : array |
| 24 | { |
| 25 | return [new Column(['id' => 'title', 'label' => \esc_html__('Landing Page', 'independent-analytics'), 'visible' => \true, 'type' => 'string']), new Column(['id' => 'utm_source', 'label' => \esc_html__('Source', 'independent-analytics'), 'visible' => \true, 'type' => 'string']), new Column(['id' => 'utm_medium', 'label' => \esc_html__('Medium', 'independent-analytics'), 'visible' => \true, 'type' => 'string']), new Column(['id' => 'utm_campaign', 'label' => \esc_html__('Campaign', 'independent-analytics'), 'visible' => \true, 'type' => 'string']), new Column(['id' => 'utm_term', 'label' => \esc_html__('Term', 'independent-analytics'), 'visible' => \false, 'type' => 'string', 'is_nullable' => \true]), new Column(['id' => 'utm_content', 'label' => \esc_html__('Content', 'independent-analytics'), 'visible' => \false, 'type' => 'string', 'is_nullable' => \true]), new Column(['id' => 'visitors', 'label' => \esc_html__('Visitors', 'independent-analytics'), 'visible' => \true, 'type' => 'int']), new Column(['id' => 'views', 'label' => \esc_html__('Views', 'independent-analytics'), 'visible' => \true, 'type' => 'int']), new Column(['id' => 'sessions', 'label' => \esc_html__('Sessions', 'independent-analytics'), 'visible' => \false, 'type' => 'int']), new Column(['id' => 'average_session_duration', 'label' => \esc_html__('Session Duration', 'independent-analytics'), 'visible' => \true, 'type' => 'int', 'filter_placeholder' => 'Seconds']), new Column(['id' => 'views_per_session', 'label' => \esc_html__('Views Per Session', 'independent-analytics'), 'visible' => \false, 'type' => 'int']), new Column(['id' => 'bounce_rate', 'label' => \esc_html__('Bounce Rate', 'independent-analytics'), 'visible' => \true, 'type' => 'int']), new Column(['id' => 'visitors_growth', 'label' => \esc_html__('Visitors Growth', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'exportable' => \false]), new Column(['id' => 'views_growth', 'label' => \esc_html__('Views Growth', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'exportable' => \false]), new Column(['id' => 'wc_orders', 'label' => \esc_html__('Orders', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_gross_sales', 'label' => \esc_html__('Gross Sales', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_refunds', 'label' => \esc_html__('Refunds', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_refunded_amount', 'label' => \esc_html__('Refunded Amount', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_net_sales', 'label' => \esc_html__('Net Sales', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_conversion_rate', 'label' => \esc_html__('Conversion Rate', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_earnings_per_visitor', 'label' => \esc_html__('Earnings Per Visitor', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_average_order_volume', 'label' => \esc_html__('Average Order Volume', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true])]; |
| 26 | } |
| 27 | } |
| 28 |