Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
integration:foxycart:google_adwords [2019/10/11 04:02] – [Step 1: Get your Google Adwords code] adam | integration:foxycart:google_adwords [2021/06/10 15:27] (current) – [Step 2: Install Adwords Tag] adam | ||
---|---|---|---|
Line 23: | Line 23: | ||
===== Installation ===== | ===== Installation ===== | ||
- | ==== Step 1: Get your Google | + | ==== Step 1: Create |
Follow the steps [[https:// | Follow the steps [[https:// | ||
Line 29: | Line 29: | ||
Once you complete the steps, you'll be offered choices on how you want to set up the tag. Select " | Once you complete the steps, you'll be offered choices on how you want to set up the tag. Select " | ||
- | 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, | + | ==== Step 2: Install Adwords |
+ | === 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, | ||
+ | |||
+ | Copy the code shown to you based on your selection into the " | ||
+ | |||
+ | === Event Snippet === | ||
In the next section for the Event Snippet, leave the default selection as Page Load. Copy the code shown here into the " | In the next section for the Event Snippet, leave the default selection as Page Load. Copy the code shown here into the " | ||
- | < | + | < |
<!-- Event snippet for Test Ecommerce conversion page --> | <!-- Event snippet for Test Ecommerce conversion page --> | ||
< | < | ||
Line 45: | Line 51: | ||
</ | </ | ||
- | Modify the script to update the '' | + | Modify the script to update the '' |
<code javascript> | <code javascript> | ||
+ | if (FC.json.first_receipt_display && !FC.json.is_updateinfo && !FC.json.is_subscription_cancel) { | ||
+ | // gtag event code here | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The resulting snippet should look something like this: | ||
+ | |||
+ | <code html> | ||
<!-- Event snippet for Test Ecommerce conversion page --> | <!-- Event snippet for Test Ecommerce conversion page --> | ||
< | < | ||
- | if (FC.json.first_receipt_display) { | + | if (FC.json.first_receipt_display |
gtag(' | gtag(' | ||
' | ' | ||
' | ' | ||
' | ' | ||
- | ' | + | ' |
}); | }); | ||
} | } | ||
Line 65: | Line 79: | ||
</ | </ | ||
- | ==== Step 2: Customise the Adwords code ==== | ||
- | |||
- | Using the code snippet you downloaded (and ensure you use the code you downloaded and not the example code pasted above), make the following changes: | ||
- | |||
- | - At the start of the code snippet, add '' | ||
- | - At the end of the snippet, add '' | ||
- | - Replace the line '' | ||
- | - Replace the line '' | ||
- | - Replace the part of the link that is '' | ||
- | - Replace the part of the link that is '' | ||
- | |||
- | Note parts 3 and 4 above may be a different number as the value - depending on what you entered when configuring the Adwords code. | ||
- | |||
- | With these changes made, you should have a snippet that looks like this: | ||
- | |||
- | <code javascript> | ||
- | {% if first_receipt_display %} | ||
- | <!-- Google Code for Your Website Conversion Page --> | ||
- | <script type=" | ||
- | /* < | ||
- | var google_conversion_id = XXXXXXXXX; | ||
- | var google_conversion_language = " | ||
- | var google_conversion_format = " | ||
- | var google_conversion_color = " | ||
- | var google_conversion_label = " | ||
- | var google_conversion_value = {{ total_order }}; | ||
- | var google_conversion_currency = "{{ locale_info.int_curr_symbol|trim }}"; | ||
- | var google_remarketing_only = false; | ||
- | /* ]]> */ | ||
- | </ | ||
- | <script type=" | ||
- | </ | ||
- | < | ||
- | <div style=" | ||
- | <img height=" | ||
- | </ | ||
- | </ | ||
- | {% endif %}</ | ||
- | |||
- | <WRAP center round important 90%> | ||
- | Use the above just as a reference - you should use the code as you downloaded in the above steps and modify that directly as described in the steps above rather than simply copying the above example code. | ||
- | </ | ||
- | ==== Step 3: Add the code to your FoxyCart store configuration ==== | ||
- | Navigate to your store' |