Jump to content

WHMCS Facebook Standard Tracking Pixel Module


Inetbiz

Recommended Posts

  • 2 years later...
  • 1 year later...
On 6/8/2018 at 10:03 AM, denyska said:

Hi Inetbiz!

Thank you for your module!

Can you please help to install it?

I uploaded all siles in modules/addons/whmcs-facebook-pixel-tracking-master but whmcs not show it on page with addons.

Thank you!

I found this article on google.  I got it working by uploading content to new folder: /modules/addons/facebookpixel

 

then login to whmcs admin > setup > addon modules and enable the module + enter PixelID.

Link to comment
Share on other sites

  • 1 month later...
18 hours ago, brian! said:

any particular reason why you didn't use a hook to do that, e.g ClientAreaFooterOutput and ShoppingCartCheckoutCompletePage ??

When I tried this first time, I don't have any idea about custom hooks.

Do you have a custom hook that you can share here because indeed my footer.tpl is messed with all the third-party scripts?

Link to comment
Share on other sites

38 minutes ago, Jafar Muhammed said:

Do you have a custom hook that you can share here because indeed my footer.tpl is messed with all the third-party scripts?

the facebook pixel hook in the above linked thread is a clientareaheadouput hook, but I assume it would work using ClientAreaFooterOutput too.

you could do a search of my posts for ClientAreaFooterOutput and see if there is one that you can adapt for your needs...

for example, the cookie hook below uses FooterOutput...

Link to comment
Share on other sites

  • 1 year later...

@Inetbiz am in love with your script. it good works. 

@cyberhostpro 

May I know if you can help me with this ? if am doing that it makes the interruption in redirection (to HTML invoice) after checkout. 

Hook code : :

<?php
if (!defined("WHMCS"))
	die("This file cannot be accessed directly");

function facebookPixelCheckOut()
{
$pixelID1 = "843460539109207";
$codepixel = "<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '".$pixelID1."');
fbq('track', \"InitiateCheckout\");
</script>
<noscript>
<img height=\"1\" width=\"1\" style=\"display:none\"
src=\"https://www.facebook.com/tr?id=".$pixelID1."&ev=InitiateCheckout&noscript=1\" />";
//echo $codepixel;
}

//add_hook("ClientAreaPageViewInvoice",1,"facebookPixelCheckOut");
//add_hook("AfterShoppingCartCheckout",0,"facebookPixelCheckOut");


?>

AfterShoppingCartCheckout redirects to the invoice page. unfortutnely., it shows the blank screen if the above hook is enabled. 

2) How to check with {if } statement in HTML invoice with tags to find out if the invoice is being viewed as client, and also logged in as admin too  

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated