x
Super Seller

Why is WEEBLY inserting their Google Analytics Account ID into my sites?

Was working with the Google Implementation team on creating some goal tracking for a set of URLs and while using their Chrome Tags Plug-in we noticed that the Events keep going back to GA account "UA-7870337-1" and not to my GA account which I added through Settings/SEO/Header Code.  After looking through the page code, I found that there is indeed another series of code configured for Google Analytics (copied below).  I looked at the code of another Weebly site you host for me (completely separate organization) and sure enough that has code pointing towards account UA-7870337-1 ...so this is clearly being inserted by Weebly and/or one of its apps.

  1. Why is Weebly doing this
  2. How do we get rid of it so that my Google Analytics can function correctly?
<script type="text/javascript">
  
 var _gaq = _gaq || [];
 _gaq.push(['_setAccount', 'UA-7870337-1']);
 _gaq.push(['_setDomainName', 'none']);
 _gaq.push(['_setAllowLinker', true]);
 _gaq.push(['_trackPageview']);
  
 (function() {
 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
 ga.src=('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
 })();
  
 </script>
Tags (2)
5,200 Views
Message 1 of 10
Report
9 REPLIES 9
Square

It wouldn't be possible to remove that code, although it shouldn't prevent you from using your own Analytics code. Many, many Weebly users are using Google Analytics with their site without trouble.

How are you implementing your event tracking with your GA code?

5,197 Views
Message 2 of 10
Report
Super Seller

Hi Adam,

I've had GA implemented via the header code for quite some time now its been working fine.  I was working with Google's Tag Implementation Team so that I could implement goal tracking for people clicking our Online Booking button/link.  We had to do a few iterations but settled on the code below, inserted into the footer.  It appears to be sending the Event to both mine and Weebly's GA accounts now (initially it would only send to the Weebly account).  Google staff recommended I work on getting your GA account ID removed from the site.  Can you expand more on why its there and cannot be removed?

One other thing to note, after adding their code to my footer, all of my text hyper links changed to a lighter shade.  I can't 100% point to this as the reason, but can't think of any other changes that were published that would cause this.  The links are now too light for the UI, in my opinion.  Can you help with that?

-Thanks!

<script type="text/javascript">
 window.addEventListener("load", function(){
 jQuery('a:contains("Book an Appointment")').click(function(){
  
 ga('send','event','button','click','book an appointment');
 });
  
 jQuery('a[href*="https://squareup.com/appointments/"]').click(function(){
 var txt = jQuery(this).text();
 ga('send','event','button','book an appointment','click',txt);
 });
 });
 </script>
5,175 Views
Message 2 of 10
Report

Hello bmarx! Just to clarify a bit, that change to the link color happened after inserting the below code, without any other changes?

5,170 Views
Message 2 of 10
Report
Super Seller

Its the only published change I can think of, but can't guarantee that caused it  ...especially since its likely a common bit of code that google provides for GA goal/event tracking

5,130 Views
Message 2 of 10
Report
Square

Have you also added the standard Google Analytics tracking code (preferrably above your even tracking code)?

5,123 Views
Message 2 of 10
Report
Super Seller

Hi Adam,

Yes I've had the GA code in for several months now.  You can take a look at the source at www.beautymarxmed.com

5,114 Views
Message 2 of 10
Report

Hi,

I'm still having same problems with Google Analytics - Google Analytics support told me that duplicated tags are the reason why it's not tracking the visits correctly.

What could be done here?

Thank you.

3,644 Views
Message 2 of 10
Report

I am getting multiple google analytics codes and have been advised by google that this needs clearing up as it causes problems. how can I delete the incorrect codes?

Annotation-2020-06-21-135520https://developers.google.com/analytics/devguides/collection/gajs/asyncMigrationExamples

ga.js is a legacy library. If you are starting a new implementation, we recommend you use the latest version of this library, analytics.js. For existing implementations, learn how to migrate from ga.js to analytics.js.

3,543 Views
Message 2 of 10
Report

One of the tags has now gone from the site, however I still get a notification for duplicate tags.

Im also getting Warnings in Google Analystics that there is no Ecommerce tag.

How can I enable Ecommerce tracking?

3,531 Views
Message 2 of 10
Report