Issue - Tracking - Add to cart - Facebook

Solved
Sty
New Member
8 0 0

Hi y'all,

 

I'm currently testing clickfunnels and I created a landingpage there with our shopify product and a button that leads to the checkout page.

I also created an ad on facebook which uses the clickfunnels link. The ad has already been running for a few days and on shopify I see a few abandoned carts but on facebook it shows me 0 add to carts.

The facebook pixel is installed on both shopify and clickfunnels. Facebook shows the add to cart conversion event location with a green light.

The link I use on clickfunnels that redirects the customers to the shopify checkout page looks like this:

https://[Domain]/cart/[variant_ID]:1?discount=[Code]

I also tried this link: 

https://[Domain]/cart/[variant_ID]:1?discount=[Code];channel=buy_button

Both links work and redirect the customer to the checkout page but its not tracked by facebook as a add to cart. It doesn't matter if the customer just lands on the checkout page or fills everything out and then cancels. No conversion tracked.

 

Anyone has an Idea what I'm doing wrong or forgot?

Thanks in advance.

Sty~

0 Likes

This is an accepted solution.

Hi Sty,
In addition to tracking your website visitors, Facebook pixel lets you track nine different “Standard Events” that people make on your website.

  1. View Content
  2. Search
  3. Add-to-cart
  4. Add-to-wishlist
  5. Initiate checkout
  6. Add payment into
  7. Make purchase
  8. Lead
  9. Complete Registration

If you want to track any of these Standard Events, as you stated “Add-to-cart” you’ll need to add some additional code to your website’s header section, just above the </head> tag.
Your website’s original code: Paste the Facebook pixel code between the <head> and </head> tags of your web page.
Your Facebook pixel base code: what you installed in the previous step of this guide
Your standard event code: Within your Facebook pixel code, above the </script> tag, paste the Standard Event code. You’ll need to add the Standard Event’s code to every page you want to track.

6.png

AddToCart either on a new page load or on the click of an Add To Cart button. There are multiple ways to handle clicks on buttons.
Here’s how the code will look:

<!-- Somewhere there is a button that performs Add to Cart -->
<button id="addToCartButton">Add To Cart</button>

<!-- Add Pixel Events to the button's click handler -->
<script type="text/javascript">
var button = document.getElementById('addToCartButton');
button.addEventListener(
'click', 
function() { 
fbq('track', 'AddToCart', {
content_name: 'Really Fast Running Shoes', 
content_category: 'Apparel & Accessories > Shoes',
content_ids: ['1234'],
content_type: 'product',
value: 4.99,
currency: 'USD' 
}); 
},
false
);
</script>

So please check if the code has been installed at standard event way on your website.

Want to modify or incorporate custom changes on store, Hire us
If helpful then please Like and Accept Solution .
Email: pallavi@oscprofessionals.com
Skype : oscprofessionals-87
Whats app
Free Website Review and advice for sale from Shopify Conversion Experts | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Shopify SEO ; Digital Marketing & amp | Site Speed Optimization | Performance Site Audit
Sty
New Member
8 0 0

Hi @oscprofessional ,

 

Thanks for your reply.

 

Is that the only way? Because a friend of mine is able to track the "AddToCart" without any extra code. He only has the Facebook pixel code installed in the header.

The only thing I noticed is that he doesn't use a discount code in his URL.

My URL: https://[Domain]/cart/[variant_ID]:1?discount=[Code]

His URL: https://[Domain]/cart/[variant_ID]:1?channel=buy_button

Could "channel=buy_button" be the trigger for his "AddToCart"?

 

And if I used your method how would I go about 2-3 buttons?

The CSS IDs of my buttons are: #button-74243, #button-54213 & #button-67234

Do I also have to add the contents, value & currency?

 

Thanks ~

0 Likes

Hi Sty, 

I can understand you concern!
Can you please check whether your friend might be integrated some third party Facebook Pixel app on shopify store.
Without standard event code AddtoCart trigger cannot be fired.
Please refer to the link for guidance:
https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/facebook-pixel

Want to modify or incorporate custom changes on store, Hire us
If helpful then please Like and Accept Solution .
Email: pallavi@oscprofessionals.com
Skype : oscprofessionals-87
Whats app
Free Website Review and advice for sale from Shopify Conversion Experts | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Shopify SEO ; Digital Marketing & amp | Site Speed Optimization | Performance Site Audit
0 Likes
Sty
New Member
8 0 0

Hey,

 

Well we decided to track the "InitiateCheckout" instead.

 

Thanks for your help.

0 Likes
nurislam
New Member
12 0 0

if it not work you need to custom coding. I have 7 years experience fb sector .if need any help touch me 

0 Likes