Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
integration:foxycart:google_adwords [2019/10/11 04:05] – [Step 1: Get your Google Adwords code] adamintegration:foxycart:google_adwords [2021/06/10 15:27] (current) – [Step 2: Install Adwords Tag] adam
Line 31: Line 31:
 ==== Step 2: Install Adwords Tag ==== ==== Step 2: Install Adwords Tag ====
  
-This will provide you with some instructions for installing the Global Site Tag first off. Complete that section for your needs. Unless you've already included the Global Site Tag within your Foxy templates or configuration, you'll select "The global site tag isn't installed on all your HTML pages" here. Copy the code shown to you based on your selection in the "header" textarea of the "Add custom header and footer code to your templates" option, as found on the "configuration" section of the Foxy administration.+=== Global Site Tag === 
 +This will provide you with some instructions for installing the Global Site Tag first off. Complete that section for your needs. Unless you've already included the Global Site Tag within your Foxy templates or configuration, you'll select "The global site tag isn't installed on all your HTML pages" here.
  
 +Copy the code shown to you based on your selection into the "header" textarea of the "Add custom header and footer code to your templates" option, as found on the "configuration" section of the Foxy administration.
 +
 +=== Event Snippet ===
 In the next section for the Event Snippet, leave the default selection as Page Load. Copy the code shown here into the "header" textarea of your configuration too. The code will look something like this: In the next section for the Event Snippet, leave the default selection as Page Load. Copy the code shown here into the "header" textarea of your configuration too. The code will look something like this:
  
-<code javascript>+<code html>
 <!-- Event snippet for Test Ecommerce conversion page --> <!-- Event snippet for Test Ecommerce conversion page -->
 <script> <script>
Line 47: Line 51:
 </code> </code>
  
-Modify the script to update the ''value'', ''currency'' and ''transaction_id'' parameters to pull the dynamic data from your receipt - that will look like this:+Modify the script to update the ''value'', ''currency'' and ''transaction_id'' parameters to pull the dynamic data from your receipt using ''FC.json.total_order'', ''FC.json.locale_info.int_curr_symbol.trim()'' and ''FC.json.transaction_id'' respectively. Also, wrap the ''gtag'' event in a javascript ''if'' conditional to only output the conversion event on the first time the receipt is loaded, and only if it's not an updateinfo or subscription cancellation - that will look like this:
  
 <code javascript> <code javascript>
 +if (FC.json.first_receipt_display && !FC.json.is_updateinfo && !FC.json.is_subscription_cancel) {
 +    // gtag event code here
 +}
 +</code>
 +
 +The resulting snippet should look something like this:
 +
 +<code html>
 <!-- Event snippet for Test Ecommerce conversion page --> <!-- Event snippet for Test Ecommerce conversion page -->
 <script> <script>
-  if (FC.json.first_receipt_display) {+  if (FC.json.first_receipt_display && !FC.json.is_updateinfo && !FC.json.is_subscription_cancel) {
       gtag('event', 'conversion', {       gtag('event', 'conversion', {
           'send_to': 'AA-11111111/AAAAAAAA1A11AAAA1A',           'send_to': 'AA-11111111/AAAAAAAA1A11AAAA1A',

Site Tools