The government is paying to promote Theresa May's Brexit deal on Google - but is facing a battle with opponents of the deal using very similar headlines.

The Cabinet Office says it will reveal how much is being spent to push the government's message to the top of the rankings when people search "what is the Brexit deal?".

However, we may not find out until after MPs vote on the deal next month.

And the government ad keeps being knocked off the top spot by a campaign group called "Britain's Future", which says May's deal betrays Brexit.

The government page says "if we reject this deal, we will go back to square one".

Image copyright Google Image caption Two contradictory adverts about the Brexit deal

The two competing sites appear to have a similar look and feel when they appear in Google search results.

Google said this did not break the terms of conditions of its site - which routinely allocates the top search spot based on an ad auction.

Theresa May is going all out to sell her deal to the public before MPs - a majority of whom are thought to be against it - vote on 11 December.

How much is it costing the government?

The Cabinet Office does publish how much it spends on marketing government policies, for example it spent £44,219 on Facebook's services in September.

But we are unlikely to know how much it has spent on promoting Theresa May's deal on Google until after MPs have voted on it.

A government spokesperson said: "Communicating government policy effectively to the public is a core function of the Civil Service.

"We have reached a deal that is good for the UK, good for its citizens, and good for business and we will be communicating that to the country. Any costs associated with this will be published in the usual way."

What do you see when you search for Brexit?

First, try yourself by clicking this link. Most people see a promoted link at the top of the results, clearly labelled "ad".

This means somebody is paying for this site to be at the top of your results.

However, the advert you see will vary depending on the time of day and where you are in the world.

You might see this advert, for a page called "Brexit Deal Explained", paid for by the government.

Image copyright Google Image caption The government's advert appears for some people

It links to a website called "Brexit Deal Explained" which sets out the government's case for the EU withdrawal agreement - and warns about the dangers of a no-deal Brexit.

Image copyright brexitdealexplained.campaign.gov.uk Image caption The government has set up a website promoting the deal

The website has video explainers about the deal as well as linking to key documents.

It also contains some supportive quotes (although this one falls rather short of a ringing endorsement).

Image copyright Joey D'Urso Image caption An "endorsement" from a business leader

The government is also paying to promote the deal with videos on social media.

But not everyone sees the same thing

Some people get a different result when they Google the same phrase.

This sponsored result appears very similar but if you look closely you can see it says the deal "betrays Brexit".

Image copyright Google Image caption An advert for a website opposed to May's deal

This article has been published by an organisation called "Britain's Future" which says it is "dedicated to making a positive, optimistic case for Brexit".

On the organisation's homepage is a series of articles criticising May's deal from a pro-Brexit perspective, arguing the deal does not deliver on the referendum result.

Britain's Future has also put up several Facebook videos in recent days criticising May's deal.

The site is run by Tim Dawson, a journalist who has written for right-leaning publications like the Telegraph and Spectator.

Tim Dawson, who described himself to the BBC as a "committed Brexiteer" said he had spent about £2,000 on his campaign.

"I'm raising small donations from friends and fellow Brexiteers", said Mr Dawson, who added that he was not prepared to reveal the identity of those who had given money.

The homepage looks rather similar to the government's one but says "the government has surrendered to the EU".

Image copyright Britain's Future Image caption This page is opposed to Theresa May's deal

The page has a video explainer giving the opposite perspective on May's deal, giving reasons why it thinks the agreement is bad for the UK.

What about abroad?

When BBC journalists in other countries searched for the phrase they got different results, showing the two adverts above are targeted at Google users based in the UK.

Here is what comes up when you search for the phrase in Brussels.

Image copyright Google Image caption What users in Brussels see

One sponsored result is for an organisation called KGH Customs, which says it "can provide you with the people, insights and services to streamline and add value to your customs procedures".

Another is for the Centre for International Governance Innovation, a think tank based in Canada.

While the UK results are aimed at the general public, the Brussels adverts seem to be aimed at policy insiders.

Searching the same phrase in France and Germany, on the other hand, brings up an advert for Barclays Investment Bank.

Image copyright Google Image caption This is what users in France see

Why do different people get different results?

Google says these are not targeted adverts where companies choose to push messages to particular audiences such as an age group or people living in a certain area of the country.

Targeted advertising, particularly on Facebook, has been a major - and controversial - feature of recent election campaigns in the UK and abroad.

Who spent what on Facebook during 2017 election campaign?

Google says the results appear differently for different people because of the "keyword bidding system".

Image copyright Google Image caption The ad is based on "current search terms"

Advertisers can choose to push messages based on searches for particular keywords such as "what is the Brexit deal".

According to Google, when a customer searches for a term matching the keyword, "your ad can enter an auction to determine if it will show... Since the auction process is repeated for every search on Google, each auction can have potentially different results depending on the competition at that moment."

This means two people sitting next to each other may see a different advert while searching the same thing despite the ads not being "targeted" as such - Google does not allow personalised advertising for political groups and other "prohibited categories".

One peculiar outcome of this is that some Google users may see the two similar-looking adverts on top of each other - one supporting May's deal and one opposing it.