Build Your Facebook Custom Audience Through Graph Search

Here’s how to build a Facebook custom audience for free using their built-in graph search feature. This method doesn’t use the API. This is purely gathering data from the public graph search page in a semi-automated way. The advantage of building a custom audience this way is it’s much more intuitive when doing searches and gives you more flexibility than the current software tools I have seen so far.

Download the “Scraper” extension for Google Chrome browser

media_1389397896947.png

Here’s the link to download the Scraper extension.

Log in to Facebook and do a search for your target audience

media_1389398005606.png

Quick Tip: To target people that may be a little more engaged with a page, use the “people that like photos by” search – e.g. “people that like photos by Ralph Lauren”.

Right click on the page and select “Scrape Similar…”

media_1389398133503.png

It doesn’t really matter where you right click becuase you will be replacing the Xpath selector in the next step anyway.

Enter this into the Xpath selector field and click “Scrape” – //div[contains(@data-bt,’id’)]/@data-bt

media_1389398350947.png

*Disclaimer – This selector path is working at the moment. If Facebook decides to change their page layout or structure then this may not work in the future – //div[contains(@data-bt,’id’)]/@data-bt

What we are doing here is scraping the page for each user’s Facebook ID. Facebook can use this value to build a custom audience for your ads.

Click Export to Google Docs

media_1389398565632.png

Delete rows with irrelevant data

media_1389398948415.png

You will need to delete any irrelevant data from the spreadsheet. The first 2 rows for example and usually the last row so you are only left with the data that contains user ID’s.

Enter this into the B1 field – =RIGHT(LEFT(A1,FIND(“,”,A1) -1),FIND(“,”,A1) -7)

media_1389398678382.png

This will select only the ID from the first column text. =RIGHT(LEFT(A1,FIND(“,”,A1) -1),FIND(“,”,A1) -7)

 

Drag that cell down using the crosshair cursor to reproduce that function on other rows

media_1389399059921.png

You can get the crosshair cursor by moving your mouse to the bottom right of the B1 cell.

Copy the contents of that column

media_1389399156258.png

Open a new Sheet and select “Paste Special” – “Paste values only”

media_1389399236378.png

This will give you a clean sheet of data that only contains User ID’s ready for export

Select File – Download As – Comma Separated Values

media_1389399345724.png

Now you can upload this CSV file to Facebook as a custom audience

media_1389399502797.png

Mike Leembruggen

Mike Leembruggen is available for consulting, contracting, and tech implementation. Mike lives and breathes 'internet marketing' and has a passion for building automated systems and marketing funnels that convert into big dollars. If you would like to speak to Mike, please send him a quick message through one of the contact forms on this site.
9 comments
Gailsanders
Gailsanders

I use "Anyaudience for facebook". It's the only scrapping tool that works for me.. I don't have any problems with that tool

mikeleembruggen
mikeleembruggen moderator

Hey guys,


Facebook has recently been cracking down on people using custom audiences so let's see how that pans out over the next few months.


Last thing I want is for you to lose your FB accounts.


I just had a quick look at the source code on FB again, and it looks like they have taken out the ID reference from graph search listings.

fredrico81
fredrico81

Could someone please update the correct xPath string?! What should we use now to scrape?

AnthonyGrant
AnthonyGrant

FB has changed their layout so selector path is not working

hainhi48
hainhi48

Hi sir!


Scrape Similer not working on my web browse, i'm using Chrome browse, 

I'm not fix it.

Can you help me?

Thanks and Best Regards :3

lussy
lussy

Thanks for tutorial, unfortunately Facebook  changed their page layout :( Can anyone advise me what to enter into the field xPath now?

?

Safrul
Safrul

Awesome... but unfortunately, it wont work already as you said it, facebook changed their layout. :(