home / russian-ads

display_ads (view)

Data source: simonw/russian-ira-facebook-ads-datasette

1 row where an ad_target was people_who_match:interests:Democratic Party (United States)

id img targeting impressions clicks url text spend_usd spend_amount spend_currency created ended
2430 location_living_in:United States, excluded_connections:Exclude people who like Born Liberal, age:18 - 65+, language:English (UK), language:English (US), placements:News Feed on desktop computers, placements:News Feed on mobile devices, people_who_match:interests:Bernie Sanders, people_who_match:interests:Social democracy, people_who_match:interests:Liberalism, people_who_match:interests:Democratic Party (United States) 49920 4799 https://www.facebook.com/bornliberall New ideas, old values. Like us! 586.0768 36629.80 RUB 2016-07-14T00:58:10-07:00  

Advanced export

JSON shape: default, array

CSV options:

CREATE VIEW display_ads AS 
        select ads.id,
            case when image is not null then
                json_object("img_src", "https://raw.githubusercontent.com/edsu/irads/03fb4b/site/" || image, "width", 200)
            else
                "no image"
            end as img,
            json_group_array(
                json_object(
                    "label", targets.name,
                    "href", "/russian-ads/display_ads?_target="
                        || urllib_quote_plus(targets.id)
                )
            ) as targeting,
            ads.impressions, ads.clicks, ads.url, ads.text,
            cast(case
                when ads.spend_currency == "RUB" then ads.spend_amount * 0.016
                else ads.spend_amount
            end as float) as spend_usd,
            ads.spend_amount, ads.spend_currency,
            ads.created, ads.ended
        from ads
            join ad_targets on ads.id = ad_targets.ad_id
            join targets on ad_targets.target_id = targets.id
        group by ads.id
        order by ads.id
Powered by Datasette · Query took 1483.777ms · Data source: simonw/russian-ira-facebook-ads-datasette