Answers.Body: <p>You can add the code using one of the below method</p>
  
  <ol>
  <li>Use <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/" rel="nofollow noreferrer">buildform</a> hook to add JS code using <a href="https://docs.civicrm.org/dev/en/latest/framework/region/" rel="nofollow noreferrer">region method</a>.</li>
  <li>Add pixel code in CRM/Contribute/For/Contribution/ThankYou.extra.tpl in your custom template directory.</li>
  </ol>
  
  <p>Note: Won't be difficult to make it generalized for each contribution page and also have it extended to event registration.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-26T03:49:01.477Z
Answers.LastActivityDate: 2020-03-26T03:54:55.357Z
Answers.LastEditDate: 2020-03-26T03:54:55.357Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>So instead of using the Drupal facebook pixel tracking module or customising the Thank You tpl file, we decided to use Google Tag Manager to create tags for Facebook pixel. </p>
  
  <p>That way, we were able to set up tracking for pixel throughout the website and also on the Civi Pay Now buttons to capture payments. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-28T07:07:43.890Z
Answers.LastActivityDate: 2020-04-28T07:07:43.890Z
Answers.UserDisplayName: P Joseph
Body: <p>We're on Drupal 7.69 and CiviCRM 5.13.x. </p>
  
  <p>One of our clients want to add facebook tracking pixel codes to the membership confirmation page after payment. </p>
  
  <p>We are using the Facebook Tracking Pixel Drupal module (<a href="https://www.drupal.org/project/facebook_tracking_pixel" rel="nofollow noreferrer">https://www.drupal.org/project/facebook_tracking_pixel</a>) to add the base tracking for the website and for webform confirmation pages. Would someone be able to help inform me on using the same module for CiviCRM confirmation pages?</p>
  
  <p>Thanks</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-26T04:33:40.913Z
Comments.Text: Does this answer your question? [Adding a Facebook Conversion Pixel Code to the contribution confirmation screen](https://civicrm.stackexchange.com/questions/321/adding-a-facebook-conversion-pixel-code-to-the-contribution-confirmation-screen)
Comments.UserDisplayName: Jon G - Megaphone Tech
Tags: <civicontribute><extension><facebook>
Title: Adding Facebook tracking pixel to contribution confirmation pages
ThreadText: # Adding Facebook tracking pixel to contribution confirmation pages
  
  (Asked by: username_0 on 2020-03-26)
  
  We're on Drupal 7.69 and CiviCRM 5.13.x.
  
  One of our clients want to add facebook tracking pixel codes to the membership confirmation page after payment.
  
  We are using the Facebook Tracking Pixel Drupal module (<https://www.drupal.org/project/facebook_tracking_pixel>) to add the base tracking for the website and for webform confirmation pages. Would someone be able to help inform me on using the same module for CiviCRM confirmation pages?
  
  Thanks
  
  **Tags:** civicontribute, extension, facebook
  
  > **Comments:**
  > **username_1**: Does this answer your question? [Adding a Facebook Conversion Pixel Code to the contribution confirmation screen](https://civicrm.stackexchange.com/questions/321/adding-a-facebook-conversion-pixel-code-to-the-contribution-confirmation-screen)  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2020-03-26. Score: 1
  
  You can add the code using one of the below method
  
  1. Use [buildform](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/) hook to add JS code using [region method](https://docs.civicrm.org/dev/en/latest/framework/region/).
  2. Add pixel code in CRM/Contribute/For/Contribution/ThankYou.extra.tpl in your custom template directory.
  
  Note: Won't be difficult to make it generalized for each contribution page and also have it extended to event registration.
  
  
  ---
  
  ### Answer by username_0 on 2020-04-28. Score: 0
  
  So instead of using the Drupal facebook pixel tracking module or customising the Thank You tpl file, we decided to use Google Tag Manager to create tags for Facebook pixel.
  
  That way, we were able to set up tracking for pixel throughout the website and also on the Civi Pay Now buttons to capture payments.
  
  
  ---
  
  