[Skip to main content](#vessel-content)

#   Sending order data to Facebook after checkout

##

- **[jcamus](/forum/user/33993-jcamus "View jcamus's Profile")**
- [![jcamus's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33993-jcamus "View jcamus's Profile") Topic Author
- [ Offline](/forum/user/33993-jcamus)

Less More

- Posts: 36
- Thank you received: 2
-
-

2 years 5 months ago [\#361485](#361485) by [jcamus](/forum/user/33993-jcamus "View jcamus's Profile")  *[Sending order data to Facebook after checkout](/forum/27-checkout/908271-sending-order-data-to-facebook-after-checkout#361485 "-- HikaShop version -- : 5.0.2 -- Joomla version -- : 4.4.0 -- PHP version -- : 8.2  Hi,  we are implementing a Facebook pixel on our website.  We have already found your advice on which HikaShop views to modify in order to send events to Facebook, based on this forum post:   www.hikashop.com/forum/integrations/9040...l-best-practice.html  However, we use a PayPal payment plugin which has a Return URL specified in the configuration. In my understanding, this means that after&#95;checkout view will never load, and we won't be able to send the order data to Facebook from there.  In case we remove this Return URL from the configuration, will PayPal still redirect back to our website and let HikaShop display the default after&#95;checkout view?  We need advice on the best way to proceed in this particular situation.  Thank you")* was created by *[jcamus](/forum/user/33993-jcamus "View jcamus's Profile")*

-- HikaShop version -- : 5.0.2
-- Joomla version -- : 4.4.0
-- PHP version -- : 8.2

Hi,

we are implementing a Facebook pixel on our website.

We have already found your advice on which HikaShop views to modify in order to send events to Facebook, based on this forum post:
[ www.hikashop.com/forum/integrations/9040...l-best-practice.html](https://www.hikashop.com/forum/integrations/904087-facebook-pixel-best-practice.html)

However, we use a PayPal payment plugin which has a Return URL specified in the configuration. In my understanding, this means that after_checkout view will never load, and we won't be able to send the order data to Facebook from there.

In case we remove this Return URL from the configuration, will PayPal still redirect back to our website and let HikaShop display the default after_checkout view?

We need advice on the best way to proceed in this particular situation.

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODI3MS1zZW5kaW5nLW9yZGVyLWRhdGEtdG8tZmFjZWJvb2stYWZ0ZXItY2hlY2tvdXQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86582
- Thank you received: 14322
-
-

2 years 5 months ago [\#361486](#361486) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Sending order data to Facebook after checkout](/forum/27-checkout/908271-sending-order-data-to-facebook-after-checkout#361486 "-- HikaShop version -- : 5.0.2 -- Joomla version -- : 4.4.0 -- PHP version -- : 8.2  Hi,  we are implementing a Facebook pixel on our website.  We have already found your advice on which HikaShop views to modify in order to send events to Facebook, based on this forum post:   www.hikashop.com/forum/integrations/9040...l-best-practice.html  However, we use a PayPal payment plugin which has a Return URL specified in the configuration. In my understanding, this means that after&#95;checkout view will never load, and we won't be able to send the order data to Facebook from there.  In case we remove this Return URL from the configuration, will PayPal still redirect back to our website and let HikaShop display the default after&#95;checkout view?  We need advice on the best way to proceed in this particular situation.  Thank you")*

Hi,

Yes, if you remove the return URL, then PayPal will use the default thank you page of HikaShop : checkout / after_end
So if you have your code in there, it will be triggered.

Note that there is already a Facebook Pixel plugin for HikaShop:
[ extensions.joomla.org/extension/hikashop...meta-pixel-tracking/](https://extensions.joomla.org/extension/hikashop-facebook-meta-pixel-tracking/)
You might want to use it instead of redoing the same thing with a view override and custom code.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODI3MS1zZW5kaW5nLW9yZGVyLWRhdGEtdG8tZmFjZWJvb2stYWZ0ZXItY2hlY2tvdXQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jcamus](/forum/user/33993-jcamus "View jcamus's Profile")**
- [![jcamus's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33993-jcamus "View jcamus's Profile") Topic Author
- [ Offline](/forum/user/33993-jcamus)

Less More

- Posts: 36
- Thank you received: 2
-
-

2 years 5 months ago [\#361529](#361529) by [jcamus](/forum/user/33993-jcamus "View jcamus's Profile")  Replied by *[jcamus](/forum/user/33993-jcamus "View jcamus's Profile")* on topic *[Sending order data to Facebook after checkout](/forum/27-checkout/908271-sending-order-data-to-facebook-after-checkout#361529 "-- HikaShop version -- : 5.0.2 -- Joomla version -- : 4.4.0 -- PHP version -- : 8.2  Hi,  we are implementing a Facebook pixel on our website.  We have already found your advice on which HikaShop views to modify in order to send events to Facebook, based on this forum post:   www.hikashop.com/forum/integrations/9040...l-best-practice.html  However, we use a PayPal payment plugin which has a Return URL specified in the configuration. In my understanding, this means that after&#95;checkout view will never load, and we won't be able to send the order data to Facebook from there.  In case we remove this Return URL from the configuration, will PayPal still redirect back to our website and let HikaShop display the default after&#95;checkout view?  We need advice on the best way to proceed in this particular situation.  Thank you")*

Thank you, we are building this ourselves because the plugin has a few issues.

For testing purposes, I tried adding some custom HTML to after_end.php, but it never showed up.

Then I tried the same with end.php, and it worked.

So in our case, the thank you message rendered at the end comes from end.php, not after_end.php

Is this normal behavior, or is there a case when after_end.php gets loaded?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODI3MS1zZW5kaW5nLW9yZGVyLWRhdGEtdG8tZmFjZWJvb2stYWZ0ZXItY2hlY2tvdXQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86582
- Thank you received: 14322
-
-

2 years 5 months ago [\#361530](#361530) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Sending order data to Facebook after checkout](/forum/27-checkout/908271-sending-order-data-to-facebook-after-checkout#361530 "-- HikaShop version -- : 5.0.2 -- Joomla version -- : 4.4.0 -- PHP version -- : 8.2  Hi,  we are implementing a Facebook pixel on our website.  We have already found your advice on which HikaShop views to modify in order to send events to Facebook, based on this forum post:   www.hikashop.com/forum/integrations/9040...l-best-practice.html  However, we use a PayPal payment plugin which has a Return URL specified in the configuration. In my understanding, this means that after&#95;checkout view will never load, and we won't be able to send the order data to Facebook from there.  In case we remove this Return URL from the configuration, will PayPal still redirect back to our website and let HikaShop display the default after&#95;checkout view?  We need advice on the best way to proceed in this particular situation.  Thank you")*

Hi,

The end view is called after you click on the "finish" button of the checkout. So this one will always be called when an order is created. But the order is likely not paid at this point.
The after_end view is called after the payment when you're redirected back to your website. But based on the payment plugin you're using and how your payment method is configured, the view might not be called.

The best is to not use a view override. Instead you can develop a plugin and implement the onAfterOrderCreate and onAfterOrderUpdate events of HikaShop, check the status of the order, and based on this, use the offsite conversions tracking to report the sale to Facebook:
[ developers.facebook.com/docs/meta-pixel/...-offsite-conversions](https://developers.facebook.com/docs/meta-pixel/implementation/conversion-tracking/#track-offsite-conversions)
This way, regardless of how the user is redirected back to the website, the payment plugin being used, etc, the orders will be properly taken into account.

That's actually what we do with the Google Analytics and Matomo plugins available for free on our marketplace.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODI3MS1zZW5kaW5nLW9yZGVyLWRhdGEtdG8tZmFjZWJvb2stYWZ0ZXItY2hlY2tvdXQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.053 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
