With the Chinese version of A Tour of Go deployed, go-dev.shuijingwanwq.com has entered a phase of continuous optimization.
Because A Tour of Go uses a Single Page Application (SPA) architecture to present course content, navigating between pages does not trigger a traditional full-page reload. Therefore, when integrating third-party analytics and advertising services, I needed to verify whether they could correctly recognize course page transitions.
This article documents a round of verification on go-dev after integrating Google Analytics, Baidu Analytics, and Google AdSense Auto Ads.
1. go-dev Single Page Application Structure
go-dev is deployed locally based on the original A Tour of Go architecture.
Course pages are switched dynamically:
- The left side displays the course content;
- The right side displays the Go Playground example;
- After clicking Next, the course page is switched via front-end logic.
For example:
/tour/basics/16
↓
/tour/flowcontrol/1The browser does not reload the entire site; it directly updates the current course state.
Therefore, traditional analytics and ad code that rely on page load events require additional verification.
2. Google Analytics 4 Single Page Analytics Verification
First, I verified whether Google Analytics 4 (GA4) could record SPA page transitions.
During testing, I observed the following request in the Network panel of the browser developer tools:
analytics.google.com/g/collectAfter clicking Next, I could see:
- The current page URL changes;
- GA4 receives a new
page_viewrequest.
For example:
dl=https://go-dev.shuijingwanwq.com/tour/flowcontrol/1
dr=https://go-dev.shuijingwanwq.com/tour/basics/17This indicates:
- GA4 has correctly identified the SPA page transition;
- No additional manual page tracking code is needed.

3. Baidu Analytics Single Page Application Support Verification
Baidu Analytics provides single page application tracking support.
After enabling:
Enable single page application data trackingI continued testing course transitions.
Testing showed that after clicking Next, Baidu Analytics could send:
hm.baidu.com/hm.gifrequests.
The request parameters include:
suand:
uwhich correspond to:
- The previous page;
- The current page.
For example:
/tour/basics/17
↓
/tour/flowcontrol/1This indicates that Baidu Analytics can now correctly record course page transitions.


4. Google AdSense Integration Testing
After completing the analytics verification, I continued testing Google AdSense.
go-dev currently uses:
Google AdSense Auto Adsautomatic ad mode.
When the page loads for the first time, it loads:
adsbygoogle.jsand initializes auto ads.
In the developer tools, you can see:
pagead2.googlesyndication.comrelated requests.
This indicates:
- The AdSense script loads normally;
- The ad request pipeline is working normally.

5. Google Privacy Messaging Verification
On first visit, Google Privacy Messaging displays a privacy prompt.
This flow is part of the Google advertising system, used to handle user privacy choices.
After completing the prompt actions, ad requests continue to execute.

6. Auto Ads Interstitial Ad Testing
During testing, Google Auto Ads successfully displayed an interstitial ad.
The browser address bar showed:
#google_vignetteand displayed the Google automatic ad page.
This indicates:
- The AdSense configuration is valid;
- The site can now participate in ad serving normally;
- The automatic ad system can recognize the current site.

7. Current In-Page Ad Status
Although Auto Ads can now work normally, in-page automatic ads have not yet displayed stably.
Inspecting via developer tools:
data-adsbygoogle-status="done"
data-ad-status="unfilled"shows:
- The ad code has executed;
- Google has completed the ad request;
- The current ad slot did not return any fill content.
This does not mean the configuration failed.
Possible reasons include:
- The new site needs to accumulate data;
- The current page structure is unique;
- Insufficient ad inventory;
- Google Auto Ads is still learning the page layout.
Therefore, I did not immediately adjust the ad code; instead, I will continue observing for a while.
8. Real Visitor Environment Testing
To rule out testing environment factors, I subsequently tested again using a normal browsing environment.
Results:
- Page access is normal;
- GA4 tracking is normal;
- Baidu Analytics is normal;
- Google AdSense requests are normal.
Currently, no anomalies have been found with the analytics and ad code integration.

9. Next Steps
go-dev has currently completed:
- GA4 single page tracking verification;
- Baidu Analytics single page support verification;
- Google AdSense Auto Ads integration verification.
Next, I will continue to observe:
- Whether Auto Ads automatically increases in-page ads;
- Whether ads are re-identified after a single page transition;
- Whether adding fixed ad units is necessary.
If more precise control over ad placement is needed later, I can consider adding fixed ad areas within the course pages rather than relying entirely on Auto Ads.
Summary
This verification confirmed the compatibility of the A Tour of Go single page architecture with third-party services:
- Google Analytics 4 can correctly record SPA page transitions;
- Baidu Analytics single page application support works normally;
- Google AdSense Auto Ads can load and display ads normally.
For single page sites that dynamically switch content using Go and JavaScript, analytics services typically need to focus on page transition events, while ad systems require continuous observation based on actual display performance.
go-dev currently has a complete analytics and advertising infrastructure in place, and the focus will now shift to user experience and ad display strategy optimization.

