Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
Google Analytics 4 Tag Manager

Data-Driven Growth: GA4 and GTM Guide

Everything you need to monitor your website traffic, understand user behavior and measure ad conversions is here. Google Analytics 4 (GA4) Predict the future with, Google Tag Manager (GTM) Put an end to code confusion with.

In this guide; Installation on PHP and WordPress sites, DataLayer You will find (Data Layer) logic, e-commerce tracking and Eka Sunucu's professional installation services.

analytics.google.com
Users 14,250 ▲ 12%
Conversions 856 ▲ 5%
Income ₺125.400 ▲ 24%

GA4
Analysis

New generation data analysis supported by artificial intelligence.

Tag
Manager

Manage all tracking codes without writing code.

E-Commerce
tracking

Selling, adding to cart and payment steps.

Conversion
Installation

Google Ads and Meta Pixel integration.

Critical Question: What is the Difference Between GA4 and GTM?

Many users confuse these two tools. Here's the simple and clear distinction:

Google Analytics 4 (GA4)

REPORTING TOOL

  • It stores and analyzes data.
  • "How many people came?", "Which page did they visit?" answers your questions.
  • It is the place that displays reports (graphs).
GTM sends data to GA4

Google Tag Manager (GTM)

MANAGEMENT TOOL

  • It places the codes on your site (Container).
  • It contains GA4, Facebook Pixel and Ads codes.
  • It commands "Notify GA4 when the add to cart button is clicked".
Expert Advice: To your site only GTM kodunu add. Manage GA4 and all other tools from GTM panel. In this way, you will not turn your site into a code dump and your opening speed will increase.

Installation Guide

Choose the method that suits your platform

GTM Setup (For All Sites)

Insert the codes you received from your Google Tag Manager account as follows:

INTO <HEAD> (To the top)
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');</script>
<!-- End Google Tag Manager -->
<BODY> IMMEDIATELY AFTER THE OPENING TAG
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
GA4 Direct Installation (Gtag.js)

If you are not going to use GTM, you can use this code <head> Add between tags:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-XXXXXXXXXX');
</script>

WordPress Installation Methods

  1. With Plugin (Easy): Install the "GTM4WP" (Google Tag Manager for WordPress) plugin. Type your GTM ID (GTM-XXXXXX) in its settings. It is the healthiest and free method.
  2. Site Kit by Google: It is the official plugin of Google. Connects Analytics, Search Console and Adsense from a single panel.
  3. Manual (Theme Editor): header.php Open the file and </head> Paste your code just before the tag. (It can be deleted when the theme is updated, use Child Theme).

Advanced Data Layer with PHP

When static tracking codes are insufficient (for example: when you want to send the logged in user's ID or cart amount to Google) DataLayer comes into play.

By printing the data (Session, Database) on the PHP side to the page as a JavaScript variable, you enable GTM to read this data.

PHP DataLayer Example
<head>
<script>
  // DataLayer dizisini başlat
  window.dataLayer = window.dataLayer || [];

  // PHP'den gelen verileri DataLayer'a it (push)
  window.dataLayer.push({
    'user_id': '<?php echo $_SESSION["user_id"]; ?>', // User ID Takibi
    'user_role': '<?php echo $user_role; ?>',         // Üye Tipi
    'page_type': 'product_detail',
    'ecommerce': {
      'currency': 'TRY',
      'value': <?php echo $product_price; ?>,
      'items': [{
        'item_id': '<?php echo $product_id; ?>',
        'item_name': '<?php echo $product_name; ?>'
      }]
    }
  });
</script>

<!-- GTM Kodu Buraya Gelecek (DataLayer'dan SONRA) -->
</head>

Professional Installation Services

Measure your data correctly, don't waste your budget

Basic Installation

1.500
One Time

Basic tracking settings for small businesses and blogs.

  • GA4 & GTM Installation
  • Form Submission Tracking
  • Whatsapp/Phone Click Tracking
  • 1 Monthly Data Control
Buy

Analysis & Audit

2.000
One Time

Let's check the accuracy of your current setup.

  • Incorrect Data Control
  • Double Count Control
  • GDPR/Cookie Compliance Test
  • Reporting Training
Request a Review

Frequently Asked Questions

Frequently asked questions about data tracking

Is Universal Analytics (UA) still working?

No, Google has completely shut down Universal Analytics. Now only Google Analytics 4 (GA4) collects data. It is imperative that you migrate your old properties to GA4.

Does using GTM slow down the site?

No, on the contrary, it speeds it up. GTM bundles all tracking codes (Facebook, Ads, GA4) into one asynchronous script. In this way, the browser makes a single request instead of loading each code separately.

Why is DataLayer important?

DataLayer is a bridge between your website (PHP/Back-end) and GTM. "What is the price of this product?", "Is the user a member?" It is the healthiest way to transfer information such as to GTM and from there to advertising platforms.

Is my data KVKK/GDPR compliant?

By default, GA4 anonymizes IP addresses, but you must obtain consent from the visitor for the use of cookies (Cookie Consent). Legal compliance can be ensured by setting "Consent Mode" via GTM.

Don't Drive in the Dark!

Turn your data into light. Make your installation error-free with Eka Sunucu expertise and use your advertising budget efficiently.

Top