Answers.Body: <p>We are doing this exact thing at the moment. I was kindly given some code that sends events to GA and Facebook pixel on the Thank You page by @jtwyman on Mattermost. A Civi developer worked with us on it to build an extension - and evolved it slightly to respect DO NOT TRACK.</p>
  
  <p>We haven't got it working 100% yet. We have an issue that completed donation £values are not being sent back to GA (membership values are being sent correctly). It's in our Github repo but private at the moment until the issue is fixed, but happy to make public and share when it's working correctly.  </p>
  
  <p>I'm not sure how others are handling this.</p>
  
  <p>EDIT: After Googling, I found that Matt Wire released an extension at the same time we had ours developed:</p>
  
  <p><a href="https://civicrm.org/extensions/google-analytics-event-and-e-commerce-tracking" rel="nofollow noreferrer">https://civicrm.org/extensions/google-analytics-event-and-e-commerce-tracking</a></p>
  
  <p>I've raised an issue asking to have our Facebook Pixel and DNT features added so that we can just star using that rather than maintaing our own:</p>
  
  <p><a href="https://lab.civicrm.org/extensions/webtracking/issues/2" rel="nofollow noreferrer">https://lab.civicrm.org/extensions/webtracking/issues/2</a> </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-01T21:44:11.970Z
Answers.Text: Thanks so much for the offer to make it public. That would be very much appreciated.
Answers.UserDisplayName: user7275
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T08:09:53.367Z
Answers.Text: Updated my answer to include edit and links.
Answers.UserDisplayName: sjparker
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-01T20:44:47.817Z
Answers.LastActivityDate: 2020-02-04T08:08:59.250Z
Answers.LastEditDate: 2020-02-04T08:08:59.250Z
Answers.UserDisplayName: sjparker
Answers.Body: <p>It might not work in this case but in case someone is trying for a temporary fix:</p>
  
  <p>Civicrm displays pages using templates. By identifying the template file you can create a file and directory structure that mimics the template used to display the part of civicrm original/path/OriginalTemplate.extra.tpl - but add .extra. into the filename. Civicrm will insert this into the page as per <a href="https://civicrm.org/blog/dave-greenberg/now-its-easier-add-custom-behaviors-templates" rel="nofollow noreferrer">https://civicrm.org/blog/dave-greenberg/now-its-easier-add-custom-behaviors-templates</a></p>
  
  <p>So for this case you'd need to in an extension or via a custom templates - set the path via Admin->System Settings -> Directories.</p>
  
  <p>Create a file at the following path:
  custom_templates_folder/CRM/Event/Form/Registration/ThankYou.extra.tpl
  templates/CRM/Event/Form/Registration/ThankYou.extra.tpl</p>
  
  <p>Then add in the html required. You'll want to wrap everything between {literal}{/literal} tags - i.e.</p>
  
  <pre><code>{literal}
    &lt;script type="text/javascript"&gt;
       Tracking js code here.
    &lt;/script&gt;
  {/literal}
  </code></pre>
  
  <p>This will insert it onto every Event registration page. If you need different codes/tracking for different pages then there is a way to do this by creating a folder with the relevant id -> Form/Registration/2/ThankYou.extra.tpl.</p>
  
  <p>However as you can identify this is not an ideal solution if the person generating and updating codes does not have easy access to upload files to your server. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-02T19:54:21.653Z
Answers.LastActivityDate: 2020-02-02T19:54:21.653Z
Answers.UserDisplayName: Luke Stewart
Body: <p>My organisation got accepted for the Google Ads Grant. There are several benefits that we can only unlock if we are able to set up conversion tracking. I am trying to get my head around how this would work with civicrm and have not had much luck with an online search.</p>
  
  <p>I'm trying to understand how one would set up the tracking code on the thank you pages since civicrm's thank you pages are automatically and dynamically generated. I'm therefore not sure where one would place the conversion tracking code.</p>
  
  <p>Has anyone here worked out how to achieve conversion tracking with Civicrm?</p>
  
  <p>Ideally the solution would allow us to easily change the tracking code so we can have the conversion of the specific thank you pages match the specific ad. Is there a way to put the tracking code into the Introductory Text or the Footer Text of the Thank-you screen within civicrm events for example?</p>
  
  <p>sorry for the many questions. Just slowly chipping away at features on our wishlist and coming across questions as we tackle them.</p>
  
  <p>Thanks for help here, it has been really appreciated.</p>
  
Tags: <civievent><civicontribute><tracked-links>
Title: Conversion tracking with Google Ads on Thank-you pages
ThreadText: # Conversion tracking with Google Ads on Thank-you pages
  
  (Asked by: username_0 on 2020-02-01)
  
  My organisation got accepted for the Google Ads Grant. There are several benefits that we can only unlock if we are able to set up conversion tracking. I am trying to get my head around how this would work with civicrm and have not had much luck with an online search.
  
  I'm trying to understand how one would set up the tracking code on the thank you pages since civicrm's thank you pages are automatically and dynamically generated. I'm therefore not sure where one would place the conversion tracking code.
  
  Has anyone here worked out how to achieve conversion tracking with Civicrm?
  
  Ideally the solution would allow us to easily change the tracking code so we can have the conversion of the specific thank you pages match the specific ad. Is there a way to put the tracking code into the Introductory Text or the Footer Text of the Thank-you screen within civicrm events for example?
  
  sorry for the many questions. Just slowly chipping away at features on our wishlist and coming across questions as we tackle them.
  
  Thanks for help here, it has been really appreciated.
  
  **Tags:** civievent, civicontribute, tracked-links
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-02-01. Score: 4
  
  We are doing this exact thing at the moment. I was kindly given some code that sends events to GA and Facebook pixel on the Thank You page by @jtwyman on Mattermost. A Civi developer worked with us on it to build an extension - and evolved it slightly to respect DO NOT TRACK.
  
  We haven't got it working 100% yet. We have an issue that completed donation £values are not being sent back to GA (membership values are being sent correctly). It's in our Github repo but private at the moment until the issue is fixed, but happy to make public and share when it's working correctly.
  
  I'm not sure how others are handling this.
  
  EDIT: After Googling, I found that Matt Wire released an extension at the same time we had ours developed:
  
  <https://civicrm.org/extensions/google-analytics-event-and-e-commerce-tracking>
  
  I've raised an issue asking to have our Facebook Pixel and DNT features added so that we can just star using that rather than maintaing our own:
  
  <https://lab.civicrm.org/extensions/webtracking/issues/2>
  
  > **Comments:**
  > **username_0**: Thanks so much for the offer to make it public. That would be very much appreciated.  
  > **username_1**: Updated my answer to include edit and links.  
  
  ---
  
  ### Answer by username_2 on 2020-02-02. Score: 3
  
  It might not work in this case but in case someone is trying for a temporary fix:
  Civicrm displays pages using templates. By identifying the template file you can create a file and directory structure that mimics the template used to display the part of civicrm original/path/OriginalTemplate.extra.tpl - but add .extra. into the filename. Civicrm will insert this into the page as per https://civicrm.org/blog/dave-greenberg/now-its-easier-add-custom-behaviors-templates
  So for this case you'd need to in an extension or via a custom templates - set the path via Admin->System Settings -> Directories.
  Create a file at the following path:
  custom_templates_folder/CRM/Event/Form/Registration/ThankYou.extra.tpl
  templates/CRM/Event/Form/Registration/ThankYou.extra.tpl
  Then add in the html required. You'll want to wrap everything between {literal}{/literal} tags - i.e.
  {literal}
    
  {/literal}
  
  This will insert it onto every Event registration page. If you need different codes/tracking for different pages then there is a way to do this by creating a folder with the relevant id -> Form/Registration/2/ThankYou.extra.tpl.
  However as you can identify this is not an ideal solution if the person generating and updating codes does not have easy access to upload files to your server.
  
  
  ---
  
  