intakedesk / PowerBI-General

Placeholder for issues migrated from Jira
1 stars 0 forks source link

FB SYNC AdCreatives Split JOBS into Weekly/Daily to save some errors #631

Closed jesusitd closed 3 years ago

jesusitd commented 3 years ago

image

25K+ Creatives come from Non-used accounts from PID 3000 (27% of total Creatives).

These are going to be taken out of the FB_CREATIVES Job to make it lighter as an initial phase to reduce the number of rows pulled in CRON.

These 2 accounts will also be moved to a weekly weekend JOB.

jesusitd commented 3 years ago

New FB_CREATIVES statement for REPLICATE:

REPLICATE [AdCreatives] SELECT *, JSON_EXTRACT(ObjectStorySpecLinkData, '$.link') AS [ObjectStorySpecLinkDataLinkUrl], SYSUTCDATETIME() AS [Timestamp], JSON_EXTRACT(ObjectStorySpecVideoData, '$.call_to_action.value.link') AS [ObjectStorySpecVideoDataLinkUrl] FROM [AdCreatives] WHERE [Target] IN ( SELECT [ID] FROM [AdAccounts] WHERE [ID] NOT IN ('act_493368164186325', 'act_441886306001178' ) )

And for FB_WEEKLY_2 Job:

REPLICATE [AdCreatives] SELECT *, JSON_EXTRACT(ObjectStorySpecLinkData, '$.link') AS [ObjectStorySpecLinkDataLinkUrl], SYSUTCDATETIME() AS [Timestamp], JSON_EXTRACT(ObjectStorySpecVideoData, '$.call_to_action.value.link') AS [ObjectStorySpecVideoDataLinkUrl] FROM [AdCreatives] WHERE [Target] IN ( SELECT [ID] FROM [AdAccounts] WHERE [ID] IN ('act_493368164186325', 'act_441886306001178' ) )
jesusitd commented 3 years ago

CC @CesarITD

DONE.