step-by-step: adding google analytics and other tracking



1. Follow the attached "End-to-End Configuration for Analytics" instructions to create your thank you page.
2. Login to your chatbot account.
3. On the left-side menu bar, press on the "Settings" button.
4. On the top menu bar press on the "Analytics Page" button
5. Copy the thank you page URL and paste it in the text box.
6. Press "Save changes".

google analytics and other tracking

End-to-End Configuration for Analytics, Adwords, FB pixel and other tracking



VirtualSpirits Chatbot provides a way to track the leads generated as conversion in tracking tools.
Below you will find the step-by-step instructions for Analytics, Adwords, FB pixel and other tracking solutions into your chatbot.

Step 1. Create Thank You page for your Chatbot.


The first step for the end-to-end solution is for you to create a thank you page on your domain that will be used by the VirtualSpirits Chatbot whenever a lead is generated in order to track this conversion.
Every time a lead is generated, the chat will load your Thank You page in the background containing the Analytics codes and other tracking codes needed to create count the conversion.

For example, a thank you page URL should look like this
https://www.mywebsite.com/thankyouchatbot

The HTML code of that page should contain the following:
- Add Google Analytics code based on analytics.js or tagmanager (for optimal solution do not use the older ga.js code)
- Add Google Adwords conversion code created specifically to track the leads of VirtualSpirits
- Add Facebook conversion pixel code created specifically to track the leads of VirtualSpirits
- Add other tracking codes created to track the leads of VirtualSpirits
- Avoid any other content to keep this page light and remove codes of VirtualSpirits inside that page as well

Step 2. Add the URL of your page in Settings.


Login to the VirtualSpirits control panel and add the URL of your thank you page
- On the left-side menu bar, press on the "Settings" button.
- On the top menu bar press on the "Analytics Page" button
- Paste the URL https://www.mywebsite.com/thankyouchatbot.

Note: If your website is still using only HTTP then your thank you page must also be HTTP. In that case past the URL http://www.mywebsite.com/thankyouchatbot

Note: Make sure you pasted the entire correct URL! Look out of relative paths or any missing parameters or values.

Step 3. Verifying Result in Real Time


Now, to make sure everything has been done correctly, your thank you page loads successfully and the tracking codes are all read, follow this procedure to make sure that you entered the correct URL and there are no more problems with executing the code added. Since this process isn’t visual and happens in the background, use traffic analyzers to check this part:

1. Launch your preferred traffic analyzer. Two popular options we suggest are: "Chrome built-in developer tools" and Chrome add-on “Google Analytics Debugger”
2. Refresh your website on your browser
3. Open the chatbot on your website and enter your contact details in to generate a lead
4. Check the logs of your analyzer to see that the thank you page is being loaded, followed by the code you entered in.
5. Repeat this step several times to make sure that everything works well


Step 4. Google Analytics Settings


You will have to make sure you have the following configuration inside your Google Analytics based on analytics.js code or tagmanager (for optimal solution do not use the older ga.js code)
Once you do these steps, you will get a clean set of Analytics from the source (e.g. adwords, organic, referral etc) through the website funnel all the way to the goal page. This is the reason only our chat should use this URL as conversion, because if all is done correctly you will NOT see virtualspirits.com in referral or inside any funnels!

1. Add a page view "Goal" like "VirtualSpirits Lead" on URL.
- Go to Admin
- Click Goals
- Click +New Goal
- Goal Setup choose which option suits you, for instance Template>Contact Us,
- Goal description give it name and choose "Destination" Destination
- Goal Details use "Regular Expression" to match the word in the URL of the thank you page for instance thankyouchatbot in case you created a page
https://www.mywebsite.com/thankyouchatbot

2. Add a page "Referral Exclusion List".
- Go to Admin
- Click Tracking Info
- Choose "Referral Exclusion List"
- Click +Add Referral Exclusion
- Add the following 2 domains:
www.virtualspirits.com
virtualspirits.com

3. Test the settings. In order to see that your configuration in Google Analytics is correct you may use Google Analytic's "Real-Time". When you visit your newly created thank you page you need to see the "goal" being counted in "Real-time" section.
In addition, if you did not add virtualspirits.com to "Referral Exclusion List" then shows top-referrals will show virtualspirits.com. Once you add virtualspirits.com to the "Referral Exclusion List" the "Real-time" section will no longer show this domain top-referrals for new leads.

Note: changes in Google Analytics do not change historical data. So if you have just updated the "Referral Exclusion List" you will need to wait 24 hours in order for measures to exclude the referral domain. Historical data will still show measures that include VirtualSpirits.com but the new data will not.

Step 5. Google Adwords Conversion in End-to-End Solution


The optimal approach to take care of Google Adwords conversion is to link your Google Analytics account with your Adwords account. If you have also setup the analytics as explained in step 4, then you will have the end-to-end visibility of the traffic sources (organic/paid) all the way to conversion.

If you're setting up Adwords conversion codes that you wish to track separately, the "conversion" must be specific to VirtualSpirits Chatbot.
If necessary you will have to create a new conversion and add it to the dedicated thank you page of step (1) https://www.mywebsite.com/thankyouchatbot

When you're looking at the reports inside Google Adwords alone do not get confused between unique conversions, converted clicks and the number of conversions you expect to see. The total number of conversions is the one you see in Adwords panel "Tools">"Conversions".

This is confusing to many people since inside the "campaign reports" that most people use you tend to see converted clicks that count several conversions as one.

Note: This is why we recommend as optimal approach to link your Google Analytics account with your Adwords account.

Step 6. Other Tracking


Using tracking solutions of other tools and service providers works mostly the same. The safest solution usually is adding the tracking code to your own domain's page you created for this purpose (which, as mentioned before, should look like this
https://www.mywebsite.com/thankyouchatbot). you can check if the tracking code was loaded properly by using the step (3) traffic analyzers

Step 7. Tracking on Multiple Domains (Cross domains)


If you are using the same chatbot on multiple websites with each having its own domain (e.g. www.websiteABC.com, www.websiteXYZ.com), you’ll have to find a solution to track your conversions across different domains ("cross domain").
You will need to create a "thank you" page for the chat for each domain separately. If you encounter any problem, please let us know and we will help you add them to the chat so you can track your conversions.

Step 8. Mobile vs Desktop statistics (Segments)


You can easily split Google analytics reports using 'segments' to accurately see traffic by device ("Desktop", "Mobile", etc.).
However this method relies on you using a single domain for all your traffic. If you are using a subdomain for your mobile traffic such as "m.mywebsite.com" then you would need a "cross domain" solution as explain previously on Step 7.
You will need to create a "thank you" page for the chat for the subdomain separately. If you encounter any problem, please let us know and we will help you add them to the chat so you can track your conversions.