# Recommended: Synchronous Loading of Tracking Code

### Why Synchronous Loading <a href="#tong-qi-jia-zai-de-li-you" id="tong-qi-jia-zai-de-li-you"></a>

With synchronous loading, when a page begins to load, the tag processing starts as soon as the JavaScript is loaded, and page loading pauses until the processing is complete. In other words, synchronous loading ensures that the tag processing begins when the JavaScript is loaded, which helps accurately measure data. The downside is that it may affect page load speed.

#### Optimizing Synchronous Loading for Page Load Speed <a href="#tong-bu-jia-zai-dui-ye-mian-jia-zai-su-du-de-you-hua" id="tong-bu-jia-zai-dui-ye-mian-jia-zai-su-du-de-you-hua"></a>

Ptengine's basic tag uses improvements, CDN, and proprietary algorithms to load within tens of milliseconds under normal network conditions, and within 500 milliseconds even when Experiences are published. Therefore, synchronous loading does not significantly impact the user experience.

* **Tag compression and caching**\
  Ptengine's tracking code reduces network bandwidth usage and download time to improve website performance.
* **Minimized code size**\
  By reducing code size, download time and bandwidth usage are decreased, improving website performance.
* **High-speed servers and CDN**\
  Using high-speed servers and CDN improves website response speed and reduces the impact of tags on page load speed.
* **24/7 monitoring**\
  We use global node monitoring services and real-time observation of tag file download speeds to promptly detect network fluctuations.

**Note:** Ptengine's base code is hosted on AWS, a computing platform with world-class networking and storage. AWS has been recognized as a leader in cloud infrastructure and platform services for over 10 years. Based on historical data, it has achieved 100% uptime for 10 consecutive years.

#### Advantages of Synchronous Loading <a href="#tong-bu-jia-zai-de-you-shi" id="tong-bu-jia-zai-de-you-shi"></a>

The advantages of using synchronous loading are as follows: (\*The following description assumes the basic tag is embedded in the HTML.)

* **Accurate data measurement**\
  Synchronous loading ensures that subsequent code only executes after the Ptengine tag is loaded. Therefore, the measured data is highly reliable and trustworthy.
* **Easy management and maintenance**\
  With synchronous loading, the Ptengine basic tag has high priority and will not be overwritten or blocked by other JavaScript code. Additionally, since it is directly embedded in the HTML, tag management and maintenance remain straightforward.
* **Compatible with all browsing environments**\
  Synchronous loading works on both desktop and mobile devices and is suitable for all websites. It also adapts to changes in various browser specifications.

In summary, synchronous tag loading improves data reliability and stability, simplifies tag management and maintenance, and supports measurement across all browsing environments.

### Asynchronous Loading <a href="#fei-tong-bu-du-qu" id="fei-tong-bu-du-qu"></a>

Asynchronous loading means that the tag processing does not necessarily coincide with the JavaScript loading time, but runs as an independent process. Therefore, unlike synchronous loading, even if one code fails to load, it does not affect other code. Since it does not block the page from displaying and does not inconvenience the user, tag management tools like Google Tag Manager typically use asynchronous loading.

#### Disadvantages of Asynchronous Loading <a href="#fei-tong-bu-du-qu-de-que-dian" id="fei-tong-bu-du-qu-de-que-dian"></a>

The disadvantage of asynchronous loading is that processing timing is unstable and data may not be measured correctly. Additionally, if page edits are performed in Ptengine Experience, page flickering may occur, and the appropriate loading method must be chosen depending on the situation, increasing management complexity.

Ptengine's tracking code uses proprietary technology to avoid delayed loading issues by employing synchronous loading.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helps.ptengine.com/en/faq/tracking-code/sync-load-recommendation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
