- Implemented a new PHP script to retrieve insights for the last N days (default 30). - Supports command-line options for token, account ID, days, API version, and output file. - Fetches data at campaign, adset, and ad levels, with filtering for active statuses. - Handles JSON output and optional file saving, including directory creation if necessary. - Includes error handling for cURL requests and JSON responses.
17 lines
462 B
SQL
17 lines
462 B
SQL
-- ROAS all time dla historii kampanii Facebook Ads
|
|
|
|
SET @sql = IF(
|
|
EXISTS (
|
|
SELECT 1
|
|
FROM INFORMATION_SCHEMA.COLUMNS
|
|
WHERE TABLE_SCHEMA = DATABASE()
|
|
AND TABLE_NAME = 'facebook_campaigns_history'
|
|
AND COLUMN_NAME = 'roas_all_time'
|
|
),
|
|
'DO 1',
|
|
'ALTER TABLE `facebook_campaigns_history` ADD COLUMN `roas_all_time` DECIMAL(20,6) NOT NULL DEFAULT 0.000000 AFTER `roas`'
|
|
);
|
|
PREPARE stmt FROM @sql;
|
|
EXECUTE stmt;
|
|
DEALLOCATE PREPARE stmt;
|