Adding The Facebook Pixel To Your Alidropship Theme [Part 2]

omktg

Active Member
CLICK HERE FOR THE UPDATE: Adding Your Facebook Pixel and Track Pixel Events OnClick on your store tutorial

Click here to read the first part: [It looks that i cant add more that 1000 characters in a single post here]
https://forum.alidropship.com/threa...-pixel-to-your-alidropship-theme-part-1.7812/

And here the InitiateCheckout event code.

Screenshot_250.png


Now go to your Alidropship store, and open the Customization tab at the bottom left of the page.

Now click on the Head tab, and paste your Pixel code in the <head> section and hit save settings.

Screenshot_241.png


Now, install the FB Pixel Helper addon for Google Chrome:

Facebook Pixel Helper Addon

Then Purge all cache form your site. If you are using Cloudflare purge all chache there too.

Now open your site in an incognito window, and navigate to the homepage, if you have the pixel helper installed, click on it, and your will see that the default PageView event is loading correctly.

Screenshot_242.png


Now, lets return to your site dashboard, and navigate to customization > Single Product > and paste the ViewContent event at the end of the shipping and payment box and hit save. I did it, and it worked fine, because that box loads every time a user arrives into a product page, so this means that our ViewContent Event on Facebook will show every user that lands in one of our product pages.

Screenshot_245.png


Next, click the Thank You tab, and Paste Your Purchase event code into the first conversion tracking script box. This will load each time a user completes a purchase successfully.

Screenshot_248.png


Now lets do the same for the Payment Fail box [Conversion tracking script]
But this time, we are going to change it a little bit. We need to change this because we dont want to track a purchase if the payment failed. So i changed the track to trackCustom [this is how Facebook knows it s a custom event], and i added NOPurchase instead of purchase. You can change it yourself, or just copy the one i pasted before and hit save.

So each time the payment failed for any reason: maybe the user did not complete the order, etc you will see that this event will track that inside your FB account.

Screenshot_249.png


Now, go to Checkout, and paste your InitiateCheckout event code after the footer text you have there and hit save.

This will add the code to the cart page. So our Initial Checkout event will be the cart page, before the user fills out his information.

Screenshot_251.png


Now, remember, purge all cache, and open your site in an incognito window to test the events.

Here you can see that the PageView default event is working fine in the homepage.

Screenshot_252.png


In the image below, you will see that in my test, the ViewContent Event is working perfectly in a product page.

Screenshot_253.png


Now here you can see that my InitiateCheckout event is loading, but it has an alert sign. i clicked on it to see what was happening, and it showed that the pixel here fired 2 times.

That was weird, so i checked the source code of that page, and noticed that the theme i was testing on [Michelangelo] was still creating a pixel code here, like in the past theme versions.

So this could be because some part of my site was still cached, or because the theme or plugin is really creating the pixel there, maybe the Alidropship team forgot to delete something there.

But anyway, i checked my FB account, and even with that alert sign, the pixel loaded fine.

Screenshot_254.png


And finally, here you can see the custom event i set up in case the purchase failed. As you can see it loads correctly.

So i assume, that the purchase event will load fine. You will need to make a purchase or maybe via COD to test it.

Screenshot_255.png


Hope this help guys.

But if you find of all this too difficult, maybe it is a better idea to buy the Facebook Business Addon Here. I haven't test it yet, but an advantage could be that it will let your create product catalogs, it includes 6 events already added to the plugin, it works with both version, WOO and Alidropship original, and you wont have to worry about adding or changing codes in your site.
 
Last edited:

omktg

Active Member
Thank you bro :) but I dont understand we should purchase or NOpurchase? Could you explian it..

Hi,

Well, the Pruchase event is an standard event on FB. So for me, the idea to collect that data is to build an audience based on it.

And while looking to the options the theme had, i noticed that it also lets you add a tracking script when the purchase failed. That was why i created a custom conversion called NOPurchase, so that i can create another audience based on it, and run a separate FB campaign retargeting those users.

That is the idea.
 

caner

New Member
I see .. Basicly that code provide us to target people who reached to payment but they did not take it..
 

nardog03

Member
Thank you for your awesome help!! can you please explain why you didn't list the "addtocart' pixel and can you show how to properly install it, please.
 

Ryan

Active Member
As I see from the Facebook guide, we must set up dynamic conversion values. But idk what's the code for Alidropship plugin. Conversion.jpg
 

omktg

Active Member
@omktg

I have an issue with purchase tracking. See picture. Do you know how to fix this? View attachment 6578
Hey,

Have you checked if the pixel is tracking that particular event? I mean, every time that someone lands in that page, does your pixel shows an event fired? Like 1 user, 2 users, or fired 10 minutes ago....

If it is tracking, then there is no problem. The issue you mention here is that we are not passing a conversion value. Facebook allows you to pass different values within an event, but in this case we are not doing it.

You can pass the conversion value for the each event you want, if you find out how to take it from your alidropship theme/plugin and pass it to the event. I am not doing it right now, because i can track values outside of Facebook.

But i will probably try to do it soon, I cant tell you when, because I am currently running some campaigns and i spend most of my time on that.
 

Ryan

Active Member
Hi, thank you for the reply.

Weird, cuz today I have no errors. Pixel is tracking purchases.

Anyway, would be great to know how to track purchase value from alidropship. Please let me know if you find out how to do that.
 

Seth

Member
Thanks for everything. But why would you put the initiate checkout after the header, then all traffic looks like it's initiating check out when it's not. Can you clarify?
 

omktg

Active Member
Thanks for everything. But why would you put the initiate checkout after the header, then all traffic looks like it's initiating check out when it's not. Can you clarify?

The initiate checkout goes in the footer of the checkout page. That page is completely different from all others: https://www.yoursite.com/cart/

So this event will fire every time someone arrives at the cart page, and this happens every time someone clicks the continue to checkout button.
 

omktg

Active Member
Guys i'm going to create a more advanced tutorial, with just click/onclick events, hopefully i will finish it this week. So stay tuned.
 

Seth

Member
The initiate checkout goes in the footer of the checkout page. That page is completely different from all others: https://www.yoursite.com/cart/

So this event will fire every time someone arrives at the cart page, and this happens every time someone clicks the continue to checkout button.
In the tutorial you make it look like initiate checkout goes in the header after pixel, and also on the checkout page. But that's not true, it just goes on the checkout page correct?
 
Hi Guys,

I'v installed fb biz add on but initiate and purchase events are not firing. I installed initiate and purchase events on my site and they're now working fine. I also purchased from my own store so i can see if purchase event is working or not.. Seems like purchase event is not also firing .. Can somebody help me on how to solve this? please...


I was not able to optimize my ads due to this matter.. Its very frustrating...

Thanks a lot for accepting me to join the forum... I appreciate it!

Jeff
 

Attachments

  • Screen Shot 2019-02-14 at 9.25.02 AM.png
    Screen Shot 2019-02-14 at 9.25.02 AM.png
    59.1 KB · Views: 21
Last edited:

ferronf

New Member
Hey bro,
Thanks for this guide. Just want to check with you, what's the difference between these standard events vs custom conversions?

Is custom conversions only used for selected URLs? If yes, it can be done via standard events as well right?
 
Top