My facebook pixel does not show add to cart event

New Member
3 0 0

Hi guys,

 

Been banging my head on this for the last 2 days, hopefully, someone can help me figure out 

 

Only show this event >> Button click automatically detected  and didn't track with pixel

 

add to cart problem.jpg

 

Is there anything obvious that I'm missing?

Thanks for your reading time, and your help.

0 Likes
Shopify Staff
Shopify Staff
70 6 12

Hey, @Adike123!

 

My name is Lilith, I'm on the Social Care team at Shopify.

 

Thanks for the screenshots and the details you provided. That was very helpful!

 

I've looked at the site that you linked in your post and tested my pixel helper to see where your pixel fires and doesn't. After taking a look at the flow of how your products get added to the cart I noticed that you're using an ajax script to keep the visitor on the same page and use the drawer to view the cart.

 

What's Happening

 

What happens with this timber drawer ajax custom modification (not supported by Shopify) is that the normal pixel event that fires when someone adds a product to cart and is taken to the cart page, it no longer viable.

 

Why It's Happening

 

When you install the pixel using the Online Store > Preferences section, your pixel's events will work normally when a customer adds a product to the cart and are then taken to the cart page.

 

If the site processes this add to cart activity differently by using a different code or script, then the basic installation of taking the customer to cart won't be used. Which means that the pixel event tracking code in that same script won't be used.

 

How to Fix It

 

The great news is that you can fix this!

 

This will require you to customize some code just like with the ajax template code.

 

This is not supported by Shopify as it is a more complex modification. However, you can certainly look into hiring a Shopify Expert if you run into any challenges.

 

What you'll do is add your Facebook Add to Cart event tracking snippet to your custom ajax code in your theme. Alternatively, you can add an inline action event code to the button on your product page.

 

Here is the link to Facebook's help guide on generating the basic tracking event codes that can be installed.

 

 

Here are some additional advanced resources for more customized event tracking on your site if you wish to explore some additional methods to track activity.

 

 

Let me know if that helped! I'm happy to answer any questions you think of as you work on your business.

Lilith | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
New Member
3 0 0

Is there anything that I'm missing?

I follower the step that you guide me but when i  open product page , it start "add to cart" event before i click the button.

 

add to cart problem2.pngadd to cart problem3.png

Thanks for your help.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
70 6 12

Hey, there! I see why!

 

The reason that your pixel is firing before you click Add To Cart is that the snippet you added is placed in an incorrect location.

 

Essentially what your code says right now is: As soon as the theme begins to load (AKA: the <head> script) track that as an Add To Cart pixel event

 

As per the instructions in the guides I sent over, you'll want to add that event code to your ajax template or ajax scripts instead.

 

Since Shopify isn't able to support custom changes such as these to the code and I've got limited information on your site I'd still recommend reaching out to a Shopify Expert. If you're on a tight budget I'd suggest speaking with Apolomultimedia first. They've done some work on my own sites in the past and have had a great experience with them.

 

Here is a screenshot of which tab or template you should be placing the code in instead.

 

 

 

27-42-eda32-d1u3w

 

 

Let me know if this helped! Feel free to ask questions, I'm more than happy to help guide you in the right direction as you work through the modified Facebook Pixel tracking code installation!

Lilith | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
New Member
3 0 0

Which level is right ?

problem 4.png

0 Likes
New Member
1 0 0

Hi! Just to let you know I have the exact same problem. 

 

The add to cart thing used to be firing and working few weeks ago with Ajaxify cart and is no longer working.

 

I've been looking in both ajaxify-cart-template.liquid file and my theme.js but without success in implementing it.

Each time I have errors or it is firing multiple times.

 

I don't know why it use to be working and I'd like to ..  

 

Now I think the easiest way is to put a custom event on add to cart button and register the ATC from here.. 

 

EDIT : it works if I put it in my JS code in the itemAddedCallback function, but it is recorded twice if a person adds multiple items to cart.

0 Likes
New Member
1 0 0

Hi, Lilith! Could you please look at my page as well? I got the same problem. Everything tracks, page view, checkouts, purchases, but ADD to Carts don't. This happens for several of my shops and accounts, even with the new ones. Before it was all great. In one service they told me that the problem is with Sticky Add to Cart button. Anyway, it would be great if you can look at it. Thank you!

0 Likes