Switching from synchronous to asynchronous code in GA
-
Morning all,
I'm looking to integrate GA with Webmasters tools but to do so I need to have the new asynchronous GA code implemented into my website.
Now, I'm happy to just copy and paste the new code into my site footer, but will that any effect on the data that I've already tracked? Is there any reason why this is really not a good idea?
Thanks for your help,
-
You'll probably notice your site loads a bit faster with asynchronous. With synchronous, the GA code is loaded with everything else on the page (like images CSS files, etc). If the GA script is slow in loading (which can happen from time to time) then the client browser is going to be left hanging there until it's fully loaded (as in the swirling "Working" icon is still there, even if everything else is loaded). Worse, if you have JS that waits until the page is fully loaded to do something important, it's now stuck waiting on that as well.
Asynchronous means that the client doesn't have to wait until that library is loaded. The GA stuff now happens in the background. This is why HTML5 has an async attribute.
As to data already stored, there would be no effect. The asynchronous scripts do the exact same thing as their synchronous counterparts.
-
Good afternoon (GMT+1 time ;-)),
The data you have already tracked in your Google Analytics will still be available after switching to the new asynchronous code. As far as I now there are no reasons why switching would be a bad idea. Because loading you're Web site even faster would already solve your problems.
Hope this helps!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
GA: How do I preserve custom dimension across domain and subdomain?
Using custom dimensions our site tracks logged-in vs not logged-in users on our shop site (shop.example.com). A user can only login on the shop.example.com. The problem is when the logged in user visits our the main domain (example.com), we lose the custom dimension and the user becomes anonymous. At this point, if the user goes back to shop.example.com, the logged-in custom dimension comes back. How do I preserve the logged-in user dimension across the main domain? Example of snippet:
Reporting & Analytics | | Evan340 -
Why do WMT's Search Analytics & GA's Real Time Keywords Differ?
I took a screen shot of the keywords from Google Analytics Real Time Keywords for Google / Organic. Then I waited a week and filtered Google Webmaster Tools' Search Analytics for queries with those keywords. None of them showed up. Why not? What I missing? Why do some keywords show up in Google Analytics RT for Google / Organic while most others are in Not Provided? I see WMT's Search Analytics says that it doesn't always show queries that "are made a very small number of times or those that contain personal or sensitive information." But most of my queries are like that. Anybody know any patterns / criteria that leads WMT to show some but not others? Thanks
Reporting & Analytics | | GilReich0 -
How does switching to HTTPS effect Google Analytics?
We are looking at making our site HTTPS. We have been using the same Google Analytics account for years and I like having the historical data. All of our pages will be the same, we are just going to redirect from the http to https. Does anything need to be done with Google Analytics? What about other addons such as Optimizely, Crazy Egg, or Share this?
Reporting & Analytics | | EcommerceSite0 -
False Conversion Data in GA
Hi all, I have a problem with Conversion Tracking in Google Analytics. Our contact form conversion completes when the user hits the Thank You page. Yesterday we had an increase in conversions that didn't correlate to form submission emails. It appears that one person filled out our form, then returned (hit the back button?) to the Thank You page another 8 times as there were 8 entrances to the Thank You page and it's currently no indexed. Is there a way to prevent this from happening? Or should I just note in Analytics that the Conversion data is wrong for that day and note how many? Thanks!
Reporting & Analytics | | nsauser0 -
Show item status in GA - LIve vs sold vs unsold
Hi guys, I am working with SEO for an auction site with B2C and C2C. (similar to eBay) All item\products on our page have an unique url. The auction can last from hours to weeks.
Reporting & Analytics | | helgeolaussen
When the item is live, sold or (finished but)unsold it still has the same url.
So when I take a look at SEO traffic to items in Google Analytics, I can't tell if the item was live, sold or unsold at the time the user landed on the page. Which makes it diffucult to analyse the traffic. Is there anyway I can make GA show the status of the item for the time user landed on it? Best regards, Ceran0 -
GA E-Commerce can't tell the real order source?
I put the e-commerce tracking code on the transaction platform (Regnow) finishing page, but all the orders displayed in GA can't tell the real order source. Instead, most of orders are from direct(none), and referrals from my site. So this is obviously wrong. I need the accurate order source such as google organic or google ppc, then I can find which keyword brings me orders. After some searches, I guess the reason is cookie domain. My GA is set as single domain tracking. And I didn't put any cookie domain code on the Regnow's transaction finishing page. The codes I put on the page are: So, suppose my site is "www.example.com". How to make sure I can track the real order source on the Regnow's transaction finishing page? Should I set my GA to track multi top-level domains, and put _gaq.push(['_setDomainName', '']); code on the tracking page? How to set the domain name, "none" or "example.com"?? Thanks in advance.
Reporting & Analytics | | JonnyGreenwood0 -
Google analytic conversion code in a single wordpress page
Hello How can I add/place the Google analytic conversion code in a single wordpress page? Example: http://www.newsmilecostarica.com/thank-you/ Thank you so much Andy
Reporting & Analytics | | newsmile0 -
Creating a Filter in GA to track Parent Category
I don't know if the title makes sense, but here's my question... Our newspaper website has multiple categories like World, Sport, Entertainment etc. Now, a story, belonging to the entertainment section maybe published on the entertainment page but is likely to have a slot somewhere on the Home page as well as other pages. The same goes for stories in sport etc. However, the url displays the date folllowed by the post title and thats it, no category name. Now, a user may end up going to a detailed story that belongs to the entertainment section (from the home page or any other page) without actually having visited the entertainment page. However, for tracking purposes, we want to see how many hits we got on the entertainment page and any story belonging to that particular section. So, my question is how do I go about creating filters that can help me track category page and detail story hits as one? Or, should I ammend the url structure (keep in mind we are using wordpress for our news website) to include category after the date and would this solve my problem of tracking? I asked a similar question recently but maybe I did not explain myself clearly. Thanks!
Reporting & Analytics | | RishadShaikh590