Facebook Audiences Using GTM: Return vs New Website Visitors

04.29.19 // Jeff Ashby

With all B2B marketing strategy, remarketing is a part that cannot be ignored, especially with ads on social media. In order to see the best results, we need to be able to fine-tune our remarketing audiences and target people at various levels of intent. The best strategies will reach people who are the most likely to convert.  People who have visited the website multiple times, or have visited many pages on the site are more valuable than people who have just visited the home page and left.  By setting up these audiences, we can direct our ad budget to higher ‘user intent’ campaigns and see better performance.

While complex remarketing audiences can be created with Google Analytics (targeting people who not only have visited certain pages, but who have come from various traffic sources, visited the page multiple times or converted at some capacity), other platforms aren’t as easy to use and don’t allow for user engagement to be a factor when loading up our audiences.

On Facebook, website remarketing audiences can mainly be made from specific pages visited using the Facebook Pixel:

In order to create more complex audiences, we can use Google Tag Manager and audience creation using Facebook Events alongside Facebook Pixel.  I’ll show you how to create a simple audience that shows only return visitors to your website.

Audience 1: Return Visitors vs New Visitors

Visitors that have visited your site multiple times are much more valuable than users that have visited your site and bounced.  It makes sense to want to target these people specifically

In order to do this, we need the following GTM components:

  • Tag: Custom HTML that fires Facebook event script
  • Variable: Cookie variable seeing if ga exists or not
  • Variable: Custom JavaScript variable to determine if visitor is a new or return visitor
  • Trigger: Firing the Custom HTML if the variable is a either a new or return visitor
Step 1 – Tag Creation – First is the Tag creation using the Custom HTML tag
fbq('track', 'Return Visitor');

Step 2 – Cookie Variable – Next is the Cookie variable. We are going to be using the Google Analytics cookie. If the cookie exists, our code will fire. To do this, we create a ‘1st Party Cookie’ variable:

Step 3 – Custom JavaScript Variable – Next we need to create a Custom Javascript variable (using the cookie variable) to determine if the cookie exists or not:
function () {
  if ({{cookie.GA}}) {
    return 'Return User';
  } else if (!{{cookie.GA}}) {
    return 'New User';

Step 4 – Trigger Creation – Finally we need to create the trigger. The trigger will trigger the tag if the variable is a return visitor and the user is visiting the first page of their website session (the reason we have to do that is because Google Analytics cookie is created immediately on the first pageview, and subsequent pageviews would always portray the user as a return visitor).  This is done by setting the Referral variable to not contain the domain name of your website.


Then we tie it all together by applying the trigger to the tag and publishing our Google Tag Manager container.


NOTE – As an alternate, we can create another tag using the exact same setup and instead change our trigger to be “New Visitor” instead of “Return Visitor” in order to create an entirely separate audience that is only users who have visited the site for the first time.

The last piece is to create our audience in Facebook using the new event we created.  After publishing our GTM container, it might take a few hours for the event to populate into Facebook (this is assuming too that we have the Facebook Pixel already installed).  Once enough time is past, we should be able to create a Facebook audience using the new event.

In the Facebook Ad Manager Audience Creation tool, that would look like this:

Then you are done.  You’ll now be able to apply this audience to your Facebook ad sets and have a much more targeted traffic based on users who have spent more time engaging with your content.

If you want to get more in-depth with your remarketing and audience building strategy, Contact Obility today.

About Jeff Ashby

Jeff joined Obility as an SEM Manager in January 2018. He's been doing Internet marketing for 11 years, with most of his time in SEO and the last couple of years in AdWords and Analytics/GTM. In his free time, he enjoys decorating sugar cookies, collecting Pez dispensers, watching cheesy Hallmark movies, and playing video games with his kids. View all Jeff Ashby’s posts >