How To Track Google Organic Traffic Using a Facebook Pixel Custom Event and Google Tag Manager

Blake Epstein

Continuing from our post on How To Create and Use Custom Facebook Conversion Events using trackCustom, let's walk through a real-world example.

How to Capture Google Organic Traffic Using Google Tag Manager

We all know that organic search traffic is extremely valuable.  So how can we leverage that value into better performing Facebook campaigns? First, we need to start by capturing this audience.

To start, we'll need to capture query strings from the URL. To do this, create a new variable with type "URL" and set the component Type to "Query".  Save your new variable as "Query String".


Then inside of your GTM container create a new Trigger and select "Page View". This should fire  when "Referrer contains google" as well as when "Query String does not contain gclid".


Next, we need to create a new HTML tag to fire our custom Facebook event. We are going to use:

fbq('trackCustom, 'OrganicTraffic');


Save and publish! This should now fire anytime a user comes from organic Google search.



Other Posts