Skip to main content

Meta CAPI Setup for Shopify

How to send adtribute data back to Meta when you are running on Shopify.

Daniel Busch avatar
Written by Daniel Busch
Updated over 3 months ago

Note, that this article only describes how to modify your adtribute Pixel in order to use our Meta CAPI setup.

You also have to follow the steps outlined in this general article for the Meta CAPI Setup.

Pixel Setup in Shopify

  1. Log into your Shopify Account

  2. Navigate to "Settings" > "Customer Events"

  3. Click on the already installed adtribute pixel

  4. Move the existing pixel code down and add the following at the top:

    !function(f,b,e,v,n,t,s)
    {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
    n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];
    s.parentNode.insertBefore(t,s)}(window, document,'script',
    'https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', 'INSERT YOUR PIXEL ID HERE');

  5. Replace the placeholder INSERT YOUR PIXEL ID HERE and insert your Meta pixel id. You can find your pixel in the "Events Manager" within your Ad Account / Business Manager.

    1. If you have multiple pixels in one store, then you need to duplicate the last line for every pixel:

      fbq('init', 'INSERT YOUR 1st PIXEL ID HERE');
      fbq('init', 'INSERT YOUR 2nd PIXEL ID HERE');
      fbq('init', 'INSERT YOUR 3rd PIXEL ID HERE');

  6. Click "Save" to update the pixel (top middle).

Note: After this setup is done, it will take up to 24 hours, before you can see the data and new events in your Ad Account.

Did this answer your question?