Facebook users in B.C. and Alberta have been bombarded with political ads supporting pipelines, while Ontario users of the social network are seeing attacks on Premier Doug Ford and his education policies, a CBC News analysis shows.

As the federal election approaches, industry groups, partisan advocates and unions have spent large sums of money to get their messages in front of Facebook users. But new political advertising rules that came into effect last month seem to have slowed down the spending spree.

CBC obtained 35,000 ads published this year on Facebook's new ad library, which the social media giant created in an effort to be more transparent and regain public trust after being accused of enabling foreign actors to interfere in elections.

The archive of ads offers a glimpse into the political messaging being crafted for Canadians in an election year.

And it shows how advertisers are making use of Facebook's ability to target audiences by location, delivering tailored messages on local issues.

In Ontario, for example, three teachers associations have been running ads critical of provincial government cuts to education. Facebook users in Alberta have been shown ads by the Canadian Taxpayers Federation urging politicians to deny equalization payments to provinces that oppose oil pipelines that would travel through their territory.

"This shows how political groups are able to use Facebook to target messages," said Stuart Soroka, a professor of political science at Michigan University who used to teach at McGill University in Montreal.

"Facebook is an extension of what we saw in the '90s, a capability to run regional TV ad campaigns thanks to technical changes."

An ad from the Canadian Energy Pipeline Association that was targeted at Facebook users in B.C., Ontario, Nova Scotia and Newfoundland and Labrador. (Facebook)

Facebook's public ad archive expanded to Canada this year in response to Bill C-76, also known as the Elections Modernization Act. Adopted late last year, C-76 forces online companies like Facebook to disclose the political ads on their platforms and the people or groups that paid for them.

Although Facebook lets advertisers target their ads to specific audiences based on gender, age, location and interests, it doesn't disclose what groups an ad was meant for.

It does, however, disclose what kinds of users saw the ad. So by looking at ads that were shown disproportionately to one group, you can get a rough idea of the types of messages that were aimed at them.

To find ads that were targeted by location, we looked at those that had at least 95 per cent of total views in a single province. The graphic below lists the 20 most frequent words in ads that were seen overwhelmingly in specific provinces.

These word clouds show the 20 most frequent words in ads that were targeted at users in different provinces and territories. The bigger the word, the more frequently it appeared. (CBC News Graphics)

The top two words in Alberta-targeted ads are "pipelines" and "equalization" because of a campaign from the Canadian Taxpayers Federation with the slogan, "No pipelines? No equalization!"

"Energy" and "move" were popular words in ads targeted in B.C., mostly due to ads from the Canadian Energy Pipeline Association (CEPA) promoting pipelines as a solution to climate change and as a contributor to the economy. CEPA ran more than 1,250 ads nationwide, 280 of which were seen only in B.C., making it Facebook's biggest political advertiser in the province.

The province has resisted the expansion of the Trans Mountain pipeline, which would increase the volume of Alberta crude carried to a port in Burnaby, B.C.

CEPA spokesperson Carla Minogue said the ad campaign is national in scope, and the high numbers for B.C. are not related to Trans Mountain resistance, but to reach users in Metro Vancouver. She said CEPA is also targeting users in the Greater Toronto Area.

"We want to reach people who are neutral in the pipeline issue and that's where they tend to be," she said.

In Ontario, "education," was a top word due to the nearly 200 ads run by three teacher associations: the Ontario English Catholic Teachers Association, the Elementary Teachers' Federation of Ontario and the Ontario Secondary School Teachers' Federation. All of their ads denounced the province's recent cuts to schools.

However, they were all outdone by North99, an advocacy group that used petitions and surveys in Facebook ads as a way to collect contact information from users.

The group's 300 ads were shown mostly in Ontario and were highly critical of Doug Ford's government.

Northwest Territories and Nunavut are excluded due to a lack of data. (CBC News Graphics)

But North99's output was topped by Fair Path Forward, a Facebook page run by Canadians for Clean Prosperity, an advocacy group that supports a carbon tax as a solution to climate change. It ran 450 separate ads aimed at Facebook users in Ontario, the highest total in any province so far.

"Clean Prosperity will be running ads until the election starts, and our goal is to educate Canadians about why a carbon tax is a fair, effective and affordable way to address climate change," said spokesperson Max Fawcett.

Some advertisers in Facebook's political ad archive are not political, and simply sell goods and services. These were caught by Facebook's algorithms, which flag words related to political issues like "energy" and "environment." Kevin Chan, head of public policy at Facebook Canada, said the company is casting a wide net out of caution, and some non-political advertisers may get added by mistake.

Big spenders

Facebook also discloses how much advertisers spent on ads. The biggest spender in Canada was a group called Shaping Canada's Future, which describes itself as a "free enterprise oriented" group. It gained notoriety in June when it ran TV spots critical of the federal Liberal government during game 5 of the NBA finals. The group has spent close to $190,000 this year on Faceobok ads alone.

The group ran all of its 61 ads in June, just before the new rules about political advertising kicked in. Facebook requires that ads about social issues or politics contain a disclaimer and disclose the organization that paid for them. None of the ads by Shaping Canada's Future had this disclaimer, despite being political, and were taken down by the social network.

Shaping Canada's Future has so far yet to respond to CBC's request for comment.

Unifor, Canada's largest private-sector union, spent more than $130,000 on 41 video ads since June urging Canadians to vote with workers in mind.

The federal Liberal and Conservative parties were the fourth and fifth biggest spenders, respectively.

New rules discouraging advertisers

Since the new advertising rules came into effect last month, the number of political and issue ads on Facebook dropped significantly, from roughly 14,000 in June to 9,500 in July.

Ads posted in June were not subject to third-party rules, which means the groups running those ads were not obligated to register with Elections Canada and publicly release their donors and spending.

One advertiser contacted by CBC said it decided to stop running Facebook ads following the introduction of the new rules out of caution. The Canadian Taxpayers Federation, which had run ads supporting pipelines and opposing inheritance taxes and the Liberal government's media bailout, ran 330 ads in June, but only one in July.

"Because this is the first time this is happening in Canada, we did this out of an abundance of caution," said Aaron Wudrick, national director of the federation. "We'll see how things go and we might reassess in the future."

Methodology

CBC collected data on more than 36,000 ads using Facebook's Ad Library API. We searched the API by advertiser ID numbers, which were published in Facebook's daily Ad Library Report. Major non-political advertisers (those that sell products or services and ran at least 50 ads or spent at least $30,000 in 2019) were excluded from the analysis. These advertisers were mistakenly classified as political by Facebook's algorithms because their ad texts may contain words associated with political issues like "environment," "guns" and "economy."

Data analysis was done using the Python programming language. Word frequencies were found using the Natural Language Toolkit.

Laura Edelson of New York University and Jason Chuang of Mozilla provided valuable expertise.

The ad data and code used for the analysis can be found on GitHub. Got any questions about this story? Contact the reporter at roberto.rocha@cbc.ca or through Twitter: @robroc