In the previous article, I documented a seemingly counterintuitive problem:
The A Tour of Go lesson pages clearly had large visual blank spaces, Google AdSense Auto Ads were enabled, and adsbygoogle.js was loading normally, but standard page display ads never appeared.
After further inspecting the page structure, I gradually narrowed the problem down to the rather unique DOM and layout approach of A Tour of Go itself.
At that point, a very natural thought occurred to me:
Since the existing SPA page structure is not conducive to displaying ads, should I simply abandon the SPA and convert each lesson into a traditional standalone page?
Purely from an AdSense perspective, this approach is actually quite attractive.
But once I actually started evaluating it, I found the problem was far from as simple as “whether the page refreshes or not.”
I ultimately decided to keep the SPA, and the biggest reason was not even page switching speed, but rather:
My multilingual version still needs to track and sync with the official A Tour of Go upstream over the long term. If I change the page architecture to a different implementation for the sake of ads, the short-term gain is convenience, but the long-term cost could be a continuously accumulating maintenance burden.
A Tour of Go’s “next page” was never a full page refresh to begin with
First, I needed to confirm one fundamental fact:
The official A Tour of Go itself uses SPA-style lesson navigation.
To verify this, I opened:
https://go.dev/tour/welcome/1Then, in the browser developer tools’ Network tab, I filtered to keep only HTML requests, and clicked “next page”.
The page quickly navigated to:
https://go.dev/tour/welcome/2The lesson content had also completely switched.
But no new Document / HTML request appeared in the Network tab.

This means that “next page” is not:
Browser requests /tour/welcome/2
↓
Server returns full HTML
↓
Browser reloads the pageBut rather closer to:
Existing page
↓
Angular handles navigation
↓
Switch lesson data and view
↓
URL updates
↓
Continue using the current DocumentFrom a user experience perspective, this approach is very natural.
Lesson switching is fast and doesn’t require reloading the entire site every time.
The code editor, lesson table of contents, and other frontend states all remain within the same application lifecycle.
But this is exactly what causes trouble for AdSense.
The ad lifecycle that is natural for ordinary websites does not exist in an SPA
For traditional multi-page websites, the logic for ads is actually very simple.
The user opens the first article:
GET /article/1
↓
Full HTML
↓
AdSense initializes
↓
Ad requestClicking for the next one:
GET /article/2
↓
New full HTML
↓
AdSense re-initializes
↓
New ad requestEvery page load inherently forms a natural lifecycle boundary.
But an SPA does not work this way.
In A Tour of Go:
/tour/basics/1
↓
Click next page
↓
/tour/basics/2Although the user thinks they have entered another page, the Document in the browser is not recreated.
This means:
You cannot simply expect AdSense to naturally restart a full page ad flow after every “next page” click, as it would on a traditional website.
So, at that point, there were roughly two paths forward.
Path 1: Abandon the SPA
The first path is the most direct.
Change the current lesson navigation into actual page jumps:
/tour/basics/1
↓
Full page load
↓
/tour/basics/2
↓
Full page load
↓
/tour/basics/3After doing this, at least a few problems would become significantly simpler.
AdSense becomes simpler
Every lesson switch is a new page visit.
Ad scripts, page content, and ad requests can all reload with the page.
No longer need to consider:
After an SPA route switch, when should old ads be destroyed, and when should new ads be created?
Analytics become simpler
Analytics systems like Google Analytics and Baidu Tongji are also more natural with traditional pages.
Every new Document is a new page visit.
Under an SPA, virtual pageviews need to be handled manually.
SEO is theoretically more intuitive
Every URL returns its own complete HTML from the server:
/tour/basics/1
/tour/basics/2
/tour/methods/1Search engines don’t need to wait for client-side JavaScript to execute before they can see the actual lesson content.
From these perspectives, abandoning the SPA is indeed tempting.
If this project were just a website I built entirely from scratch, I might seriously consider doing so.
But the A Tour of Go multilingual project has another very important constraint.
This project is not a completely standalone Tour
My goal has never been to reimplement an “A Tour of Go-like website”.
Rather, it is to maintain a multilingual version based on the official A Tour of Go.
The official current lesson content is primarily located at:
golang/website/_content/tour/It includes:
basics/
concurrency/
flowcontrol/
generics/
methods/
moretypes/
welcome/
static/
template/
basics.article
concurrency.article
flowcontrol.article
...
_content/tour/ in golang/website. Lesson content, static assets, and templates are all continuously maintained in this upstream directory.There is another detail worth noting in this screenshot:
Some upstream lesson files have just been modified within the past few days.
For example, you can see:
yesterday
5 days ago
last weekThis means A Tour of Go is not a frozen codebase that will never change.
The upstream will continue to modify:
- Lesson text;
- Example code;
- Templates;
- Static assets;
- Frontend behavior;
- Go version-related content.
At this point, “changing the SPA to a traditional multi-page architecture” is no longer just a one-time development effort.
It becomes:
From now on, every upstream sync must consider whether my forked architecture can remain compatible.
My project even officially records the upstream revision
This upstream relationship is not just a verbal “occasional reference”.
go-tour-i18n itself officially records the upstream baseline.
The project status saves something like:
golang/website master@645042eb...When the upstream changes, this baseline is updated through my own sync process.
The production bundle also writes into release.json:
upstream_commit=645042eb...
This means that for this project:
upstream revision
↓
source sync
↓
TranslationUnit status
↓
re-translate / review (if needed)
↓
build
↓
publish
↓
productionIt is inherently part of a long-term engineering process.
So when I finally evaluated the SPA problem, my main concern was no longer:
Is it hard to change to ordinary pages?
But rather:
Years from now, will I still be willing to maintain this version that differs from upstream?
Comparing the two paths side by side again
My final judgment at the time can roughly be summarized in the table below.
| Dimension | Keep SPA | Abandon SPA |
|---|---|---|
| Closeness to upstream architecture | High | Significantly reduced |
| Subsequent upstream sync | Changes are relatively centralized | Requires continuous adaptation to my own page architecture |
| “Next page” experience | Native SPA fast switching | Full page refresh per page |
| Editor and lesson interaction | Closer to upstream | Requires reconfirming state and initialization behavior |
| AdSense | Requires active management of SPA ad lifecycle | Naturally re-executes on every page load |
| Page analytics | Requires handling SPA pageviews | Ordinary pageviews are more natural |
| SEO | Requires extra effort to solve client-side rendering issues | Server-side standalone pages are more direct |
| Initial development | Ad and SEO handling is more complex | Seems more direct |
| Long-term maintenance | Smaller difference from upstream | Custom differences continuously accumulate |
If I only look at a single row:
AdSenseThen I would likely choose to abandon the SPA.
But if I include the last row:
Long-term maintenanceThe conclusion starts to change.
One-time complexity and long-term complexity are not the same thing
This actually involves an engineering issue I increasingly value.
Some approaches seem “simple” only because they postpone complexity until later.
For example, abandoning the SPA.
When first implementing it, maybe I only need to:
Modify the next page link
↓
Server directly returns the corresponding page
↓
Let the browser reloadIt looks very simple.
But later, once the upstream modifies the Tour’s:
- Routing;
- Angular controller;
- editor lifecycle;
- lesson data structure;
- template;
- navigation;
- Playground behavior;
My non-SPA implementation would need to evaluate item by item:
Can this change still be synced directly?
Which part is already unusable?
Do I need to reimplement it again for my own architecture?
Over time, the gap between the two codebases will only grow larger.
This is the so-called maintenance fork.
While the other path is initially more troublesome:
Keep the SPA, and then separately solve the SPA ad lifecycle.
But its complexity is mainly concentrated in the new ad layer I add.
The ideal state could be:
Upstream Tour
↓
Keep the original structure as much as possible
+
My own locale layer
+
My own ad lifecycle layerRather than:
Upstream Tour
↓
Continuous conversion
↓
My own alternative page frameworkThe difference between these two architectures will be huge after maintaining the project for a few years.
Ads should adapt to the project, not the project adapt to ads
This is also the core reason I ultimately decided to keep the SPA.
Google AdSense is important for this project.
It affects whether the site can cover some of the server, domain, and maintenance costs going forward.
But ads are ultimately an add-on capability.
The most core things for the A Tour of Go project remain:
- Official Go lesson content;
- Keeping in sync with upstream;
- Multilingual translation;
- Playground;
- Lesson interaction;
- Long-term maintainability.
If I significantly modify these foundational architectures for the convenience of ads, the priorities are actually reversed.
So the final principle became:
Do not abandon the SPA for AdSense.
Furthermore:
Try to have the ad implementation adapt to A Tour of Go, rather than redesigning A Tour of Go for ads.
But keeping the SPA does not automatically solve the ad problem
Of course, making this decision does not mean the problem is solved.
Quite the opposite.
Choosing to keep the SPA means actively accepting the problem that must be solved next:
User enters lesson page
↓
Display an ad
↓
Click "next page"
↓
Document does not refresh
↓
What happens to the old ad?
↓
Does the new lesson need a new ad?
↓
When to request again?
↓
How to prevent ad nodes from continuously accumulating?And there is an even more fundamental problem:
Where exactly should the ad be inserted?
The original Auto Ads didn’t even use the large visual blank space on the page.
If the application explicitly provides its own ad slots, where should they be placed:
- Below the left text column?
- Below the right editor?
- Outside the two columns?
- Above the footer?
- Below the footer?
The page preview in the Google AdSense backend later happened to give a very interesting answer.
It did find a place “where an ad can be placed”.
But that position made me realize:
The position Google thinks is suitable for an ad is not necessarily the position where I want users to see ads.
So the problem entered the next stage:
Since I decided to keep the SPA, where exactly should the lesson ads be placed, and who should manage their lifecycle?

