Brookly Theme and Facebook Pixels

New Member
3 0 1

Hello,

 

I am working on my shop and try to get Facebook Pixels functioning.

I use the Brooklyn theme and added the Facebook Pixels ID to my shop.

 

Facebook Pixels shows me only 4 events:

PageView, ViewContent, AddToCart, InitiateCheckout

 

I added 5 custom conversions (according to youtube):

AddToCart: URL contains /cart

ViewCollection: URL contains /collections

ViewProduct: URL contains /product

Purchase: URL contains thank-you

Initiate Checkout: URL contains /checkout or /checkouts

 

1.

I recognized that Purchase can't work because Brooklyn doesn't use /thank-you in any URL. How I can solve this? I can't create a custom audience with Purchase as event (I think it is, because there is no activity yet).

 

2.

InitiateCheckout has 2 Events received, but my custom conversion Initiate Checkout shows no activity. Why? Aren't /checkouts or /checkout used in Brooklyn? How can i fix it? 2 Events can't be true.

0 Likes
Shopify Partner
5 0 2

I just found a solution to my problem with the Brooklyn theme and the nice AJAX drawer cart not firing up the "AddToCart" pixel event in Facebook (thus ruining my tracking). After trying several things I figured out this simple solution:

 

in product-template.liquid:

 

...

<div class="product-single__add-to-cart{% if section.settings.add_to_cart_button_size == 'large' %} product-single__add-to-cart--full-width{% endif %}">
                <button type="submit" name="add" id="AddToCart--{{ section.id }}" class="btn btn--add-to-cart{% if section.settings.enable_payment_button %} btn--secondary-accent{% endif %}"{% unless current_variant.available %} disabled="disabled"{% endunless %} onClick="fbq('track', 'AddToCart')">
                  <span class="btn__text">
                    {% if current_variant.available %}
                      {{ 'products.product.add_to_cart' | t }}
                    {% else %}
                      {{ 'products.product.sold_out' | t }}
                    {% endif %}
                  </span>
                </button>

I just inserted the bold code (onClick="fbq('track', 'AddToCart')) inside the add to Cart button. 

 

I hope this helps others using the Brooklyn theme.

 

Cheers!
Simon

2 Likes
New Member
1 0 0

Thanks Simon, you're the man !!!

0 Likes
New Member
2 0 0

Hey, I was having the same problem with ATC's and your solution worked great so thanks for that. Only problem now is my pixel is still not tracking initiated checkout did you have that problem? Would be awesome if you could give me a solution for that 

0 Likes
New Member
1 0 0

Where exactly did you put the Code in?

0 Likes