cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jonathanc
Community Member

Google Analytics Tracking Code Mismatch

Hello all,

We have recently started to use Google Analytics here at my school and I followed the directions as mentioned in  @jperkins ‌'s 'How To Set Up Google Analytics for Canvas'. Everything worked fine and I was seeing data flowing in until a few days ago. I now receive a 'tracking code mismatch' notification in Google Analytics, stating the default URL has no tracking code for this property, but that it has tracking codes for other properties (UA-9138420-1). Since receiving this message, I have checked and re-uploaded the JavaScript file to the ThemeEditor. I'm not the best with this stuff but I've done almost everything I can think of to rectify the problem and nothing has worked so far. I'm hoping someone here can push me into the right direction.

Thanks in advance!

8 Replies
chofer
Community Coach
Community Coach

Hello  @jonathanc ...

While I don't necessarily have an answer for you myself, I wanted to let you know that I am going to share your question with the https://community.canvaslms.com/groups/big-data?sr=search&searchId=c5d0fedc-c3e9-483f-b10f-b5c73f314...‌ group here in the Canvas Community in hopes that your question will get some additional exposure.  If you are not yet following that group, you can use the link I've provided, and then click on the "Follow" button at the top right corner of the page.  Also, you may need to click on the "Actions" menu (also at the top right corner of that page) and then click on "Join group".  I hope this will be of some help to you, Jonathan!

christopher_phi
Community Champion

Hey  @jonathanc , "tracking code mismatch" generally indicates that the Google Analytics Tracking ID you are using does not match up with the URL of your Canvas instance. Each Tracking ID is affiliated with a specific URL - if those don't match up then that error with show up. I don't know what it would have worked for a few days and then stopped working, but you should be able to check to make sure those are both in sync by going to: 

Google Analytics > Administration > Property Settings then check "Tracking ID" and "Default URL" and make sure the Tracking ID is the one you have included in the Google Analytics code you added to your custom JavaScript and that the URL matches your instance of Canvas. For example ours is usu.instructure.com/. 

The Google Analytics Debugger Extensions for Chrome may also be helpful to see what the problem is. 

Thanks,  @christopher_phi ‌! Unfortunately, I already had a look at the property settings and double-checked the "Tracking ID" and "Default URL" to make sure before I posted this. I even installed Google's Tag Assistant extension and ran it on our URL. I've attached a screenshot of the result below.

Anyway, to update everyone, I am now seeing data flowing back into GA but I have no idea why or how this has happened. Tag Assistant still shows an error so if anyone has an idea about what is happening, I'd still love to figure this out to be safe.

259662_Tag Assistant Screenshot.png

It looks like the Canvas Google Analytics code is running fine. If you click on the other one that is showing the error it should give you some more information about the specific error. Can you share a screenshot of what the specific error is? If you could take a screenshot of what error it is showing you? Is it still the "tracking code mismatch" error or something else? 

kristin_bayless
Community Contributor

 @johnychang82 ‌ so glad to have found your post.  I installed Google Analytics in our Canvas instance a few days ago and am getting the same notification, right down to the tracking code you listed - UA-9138420-1.

I also saw data for a bit, then nothing.  When I came back today, there is more data and real-time movement.  Did you see any odd locations under the "Where are they coming from?" widget on the dashboard?  I saw an odd location yesterday, but chalked it up to someone attending a conference.  I'm glad you posted this, or I would have been wiping out and reinstalling today. I checked our Canvas js, and there's no mention of this tracking code, only the one we generated. 

One thing I did was to install in test prior to the live instance.  But I wiped the js out from test when I posted to live.  Wonder if that contributed to this?

The "UA-9138420-1" tracking code is the code that Canvas uses across all instances of Canvas - they are collecting data at Instructure that I don't think we have any access to. 

The second number specific to your Google Analytics is the right one. It can take some time for Google to initially begin 

Hey  @christopher_phi ‌ &  @kristin_bayless ‌! Thanks for both of your replies. Yes, I searched for that tracking code and found that it is used by Instructure so yes, that would make a lot of sense! Thanks for clarifying that. I will have a look at Tag Assistant again and see what is going wrong with our tracking code. I'll update this thread once I check it out.

Robbie_Grant
Community Coach
Community Coach

 @jonathanc ,

Were you able to find an answer to your question? I am going to go ahead and mark this question as answered because there hasn't been any more activity in a while so I assume that you have the information that you need. If you still have a question about this or if you have information that you would like to share with the community, by all means, please do come back and leave a comment.  Also, if this question has been answered by one of the previous replies, please feel free to mark that answer as correct.

Robbie