Dynamic Number Insertion - Troubleshooting (Advanced)

Dynamic Number Insertion - Troubleshooting (Advanced)


This article is part two of a two-part guide in troubleshooting AVANSER's Dynamic Number Insertion code on your website. This guide will help ensure that the code is installed correctly, and is working as expected. If you have not already attempted the steps in the basic troubleshooting article, then we highly recommend you do that first.

This article takes you through some advanced steps in troubleshooting your Dynamic Code installation and involves checking that the code is present on-site using the browser developer console in tandem with browser extensions.

For this article AVANSER recommends using Google Chrome to troubleshoot, as all shortcuts and instructions will be specific to Chrome. If you are familiar with your browser's developer tools it is still possible to follow along in your browser of choice. 

ACCESSING THE DEVELOPER CONSOLE

Many of the steps that follow require access to Chrome's developer tools. This will allow you to run some scripts that we will provide to check everything is installed correctly. To access the developer console press F12 or Ctrl + Shift + I whilst in Chrome. By default the tool will appear at the bottom of your browser window. To make using this tool easier it is recommended to separate this into its own window, as this makes it easier to view the website whilst using the tool. 
  1. Click the settings   icon in the top-right corner of the developer tools window. 
  2. In the dockside menu click the separate window  icon.


STEP 1: Check that Google Analytics is installed

AVANSER's Dynamic Number Insertion code uses Google's cookie to determine the origin of the site visit; this cannot be done if Google Analytics isn't installed correctly on the website. One of the easiest ways to check if Google Analytics is running is by using the Google Tag Assistant extension in Chrome. This extension looks at scripts running on your site and lists those that it detects successfully. If you do not already have Tag Assistant installed in Chrome please click this link to proceed to the download page. Once on this page click   in the top-right corner. A popup will appear confirming what this extension is able to do once installed. To proceed click "Add Extension" then follow the prompts to complete the installation.

Once installed you will see the Tag Assistant icon  in the top-right of your browser. Clicking this icon will allow you to select which scripts the extension should check for when activated. Ensure that at least Google Analytics is checked, then click done:



To use the extension on a site, click the Tag Assistant icon  and click "enable". Then using the same tab in your browser navigate to your website. 



Once your website loads, click the Tag Assistant icon  again and it will list the scripts it detected on your site. Ensure that Google Analytics is included in the list and upon clicking on it, that there are no errors:



Google Analytics Is Listed And Functioning
Please proceed to step 2. 

Google Analytics is Not Listed Or Functioning
Please seek assistance from whomever manages your website, and request they install Google Analytics on your website. You can still proceed with the next steps to ensure all other elements of the code are ready, but you will not be able to perform any successful number swaps on your website until Google Analytics is installed correctly.  


STEP 2: Check that jQuery is installed

AVANSER's Dynamic Number Insertion code uses jQuery to change the phone numbers displayed on your website. If jQuery is not correctly installed, then the code will be unable to dynamically swap the phone numbers.

To check if jQuery is installed open the browser developer tools. When the window appears, click the "Console" item from the top menu:



In the main window of the console next to the script  icon, copy and paste the following script and then hit Enter:
  1. jQuery.fn.jquery

If jQuery is correctly operating a version number will display informing you of which jQuery verstion you have installed:

 

AVANSER only officially supports jQuery version 1.9.1 and over. If your installed jQuery is an older version, you may need to update it for the AVANSER code to work. The most recent version of jQuery can be found here.

If jQuery is not operating you will be presented with an error message:



Supported jQuery Version Is Installed
Please proceed to step 3.

jQuery Is Not Installed Or Is Unsupported Version
In order for your numbers to swap on-site, jQuery must be installed correctly. Please check with whomever manages your website and request that jQuery be installed. You can still proceed with the next steps to ensure all other elements of the code are ready, but you will not be able to perform any successful number swaps until jQuery is installed correctly.


STEP 3: Check that the AVANSER Dynamic Number Insertion Code is installed 

To check the AVANSER code is installed correctly on-site open   the browser developer tools. When the window appears, click the "Console" item from the top menu:  


In the main window of the console next to the script  icon, copy and paste the following script and then hit Enter:
  1. $AA.config.debug=true

If the AVANSER code is present and running the console will return "true":



If the AVANSER code is not present and running the console will return an error message:



AVANSER's Code Is Installed
Please proceed to step 4. 

AVANSER's Code Is Not Installed
Please seek assistance from whomever manages your website and request they install the AVANSER code on your website. If you have misplaced or do not have a copy of the installation instructions please call support on 1300 307 247 to request another copy. Your code may have components unique to your account so we are unable to include these instructions as part of this guide.


STEP 4: Check a visit from your ad is tagged correctly

If Google Analytics, jQuery, and the AVANSER code are all successfully installed on your website the next thing to check is that your ad is tagging the visit correctly. The AVANSER code will not swap out the phone number on your website if the cookie indicates the visitor has arrived from a campaign that is not being tracked by AVANSER. 

To complete this step please click one of your ads, or simulate a visit from one of your ads as described in the Basic Testing/Troubleshooting article. Once you have completed this, open your browser's developer console. When the console appears, click the "Console" item from the top menu:


In the main window of the console next to the script  icon, copy and paste the following script and then hit Enter:
  1. $AA.data.track

This will show you the cookie data collected by the AVANSER code. Next to the result click the expand icon   to see all the data. Check the "S" (source), "M" (medium), and "C" (campaign) items to see if they match the advertisement you clicked/simulated:



Common mediums and sources:

Ad Type
Medium (m:)
Source (s:)
Paid Search
cpc
google/bing/yahoo
Organic Search
organic
google/bing/yahoo
Display Ads
display
Various - will show the URL of the site that presented the ad to the customer
Referral
referral
Various - will show the URL of the site that presented the ad to the customer
Direct Traffic
direct
N.A.

My Tags Are Correct
Please proceed to step 5. 

My Tags Are Not Correct
If you clicked on one of your ads this indicates that your ad is not tagging visits correctly. Please check with whomever manages your online ads to ensure that auto-tagging is enabled and/or your ad URLs are manually tagged. This could also indicate that your cookies still haven't been cleared properly and you may want to revisit step 1 of the Basic Testing/Troubleshooting article before trying again.


STEP 5: Make sure AVANSER's Dynamic Number Insertion code is not running too early

It's important that the AVANSER code runs once the page has loaded. This ensures that Google's code has had sufficient time to run and populate the cookie data, and that the phone number has loaded and is able to be swapped.

To complete this step please click on one of your ads, or simulate a visit from one of your ads as described in the Basic Testing/Troubleshooting article. Once you have done this, open your browser's developer console. When the console appears, click the "Console" item from the top menu:


In the main window of the console next to the script  icon, copy and paste the following script then hit Enter:
  1. $AA.track()

Once run successfully the console will display details of the swaps taking place on site:



My Phone Numbers Swapped
This indicates that the AVANSER code is running too soon on your website. Please proceed to the next step for instructions on how to adjust your code to run at the correct time. You may require assistance from whomever manages your website to complete this step.

My Phone Numbers Did Not Swap
This will require more complex investigation by our support team. If you have not already raised a ticket please email support@avanser.com to open an investigation.


ADJUSTING YOUR AVANSER DYNAMIC NUMBER INSERTION CODE TO RUN AT THE CORRECT TIME

If your phone numbers swapped during the previous step you will need to adjust when your AVANSER code runs on your website. How you go about this will depend on whether your code was implemented directly on your website, or if it was implemented through Google Tag Manger. You may require assistance from whomever manages your website to complete this step. 

Direct On Site Implementation

You will require your installation instructions to complete this adjustment. If you no longer have your installation instructions please contact support on 1300 307 247 to request another copy. 

Search for the AVANSER code you originally placed on your website and remove it (easiest way is to search for "AVANSER"). Next, copy the code supplied in the instructions and paste it just before the closing </head> tag on your website. Ensure that it is after the Google Analytics and jQuery scripts. 

Once this is complete please go back and test your code again to ensure that your numbers are now swapping correctly. If you have any questions or require additional assistance please contact our support team by email at support@avanser.com.

Tag Manager Implementation

Open Google Tag Manger by clicking this link and signing into your account. Select "Tags" from the menu on the left-hand side of the screen:



In the main screen locate your AVANSER dynamic code in the tag list. If you named your tag appropriately you should be able to do this by clicking the search  icon and typing in "AVANSER". Once located, click the name to open up the tag details. Mouse over the "triggering" section of the popup and click the edit  icon to adjust when the code will run. Create a new trigger by clicking the add icon in the top-right corner of the screen and add the "DOM Ready" trigger:



Click the   button in the top-right corner of the popup to lock in your changes. Before these changes are made live to your site you will need to click the   button in the top-right corner of the page. You will be prompted to write some details about the changes you made which will assist with version control of your website before confirming the changes. 

Thank you for following this troubleshooting guide. If you are still experiencing issues or have further questions please contact our support team at: support@avanser.com
    • Related Articles

    • Dynamic Number Insertion - Troubleshooting (Basic)

      This article is part one of a two-part guide in troubleshooting AVANSER's Dynamic Number Insertion code on your website. This guide will help ensure that the code is installed correctly, and is working as expected. This article covers the basics of ...
    • Dynamic Numbers: Service Summary

      AVANSER Dynamic Numbers is a service designed to replace the Phone Numbers in your Website with an AVANSER Tracking Number, this process does not change the source code of your Website, but, instead, process your Website when is displayed to ...
    • Dynamic Number Insertion

      Access to this tool has been limited to authorized users only. If you required certain users to have access to this module, please contact your Account Manager. The dynamic numbers configuration section allows user to add new tracking codes to their ...
    • Dynamic Numbers: Installing jQuery - Required by AVANSER Tag Manager

      Installing jQuery Library is not required if you are using Dynamic Numbers' Automated Number Replacement or you are not using AVANSER Tag Manager. The AVANSER Tag Manager allows you to set rules for your website that dynamically adds span tags to the ...
    • Troubleshooting Call Issues

      If you are experiencing issues with your AVANSER phone numbers, chances are you've already performed some initial testing to confirm the problem. Below are some common scenarios and related troubleshooting methods which we recommend you attempt ...