Posts under category Google

When I implement a GoogleAds conversion event I recognize multiple network requests to various domains. Can someone explain what (and why) is happening here?

I got the idea of providing information about a certain event to a specific endpoint (or monitoring system -> GoogleAds) but I do not understand the different purposes of these multiple requests.

Code Example

var script = document.createElement('script'); script.src = "https://www.googletagmanager.com/gtag/js?id=AW-XYZ"; document.querySelector("head").appendChild(script); window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-XYZ'); gtag('event', 'conversion', { 'send_to': 'AW-XYZ/abc123', 'transaction_id': '123456789' }); 

Network Requests

Domain: googletagmanager.com/gtag/js?id=AW-XYZ Status: 200 Type: Script

Domain: googleads.g.doubleclick.net/pagead/... Status: 200 Type: script

Domain: googleadservices.com/pagead/... Status: 200 Type: script

Domain: googleads.g.doubleclick.net/pagead/... Status: 302 Type: gif

Domain: google.com/pagead/... Status: 302 Type: gif

Domain: google.de/pagead/... Status: 302 Type: gif

I'm working to get cost grouped by country of my account with Google ads API. But I got some country_criteria_id that I couldn't found in Geo Target CSV file. And after googled this I found these country may be meet Google Ads country restrictions policy, but I couldn't find the relationship between the ids and countries.

2192 2736 2760 2408 

Can you tell me the relationship?

Recently, I made an android app. After that, I have opened my account in AdMob and entered my app. I have got an App ID and Unit ID. For the first time, I tested my App with testing ID codes from developers.google.com. It worked well. But I have put IDs which are from AdMob in my codes. As a result, It is not displaying. Here is my Manifest.xml file

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     package="com.example.myapp2">     <uses-permission android:name="android.permission.INTERNET" />     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />     <application         android:allowBackup="true"         android:icon="@mipmap/ic_launcher"         android:label="Lotin-Kirill Converter"         android:roundIcon="@mipmap/ic_launcher_round"         android:supportsRtl="true"         android:theme="@style/AppTheme">         <meta-data             android:name="com.google.android.gms.ads.APPLICATION_ID"             android:value="ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx"/>         <activity             android:name="com.example.myapp2.Splash"             android:screenOrientation="portrait"             tools:ignore="LockedOrientationActivity">             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                 <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>         <activity             android:name="com.example.myapp2.MainActivity">         </activity>         <meta-data             android:name="preloaded_fonts"             android:resource="@array/preloaded_fonts" />     </application> </manifest> 

It is build.gradle(:app)

apply plugin: 'com.android.application' android {     compileSdkVersion 29     buildToolsVersion "29.0.3"     defaultConfig {         applicationId "com.example.myapp2"         minSdkVersion 16         targetSdkVersion 29         versionCode 1         versionName "1.0"         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"     }     buildTypes {         release {             minifyEnabled false             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'         }     } } dependencies {     implementation fileTree(dir: 'libs', include: ['*.jar'])     implementation 'androidx.appcompat:appcompat:1.1.0'     implementation 'androidx.constraintlayout:constraintlayout:1.1.3'     implementation 'com.google.android.gms:play-services-ads:19.2.0'     testImplementation 'junit:junit:4.12'     androidTestImplementation 'androidx.test.ext:junit:1.1.1'     androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' } 

Here is MainActivity.java

package com.example.myapp2; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; import android.os.StrictMode; import android.view.View; import android.webkit.WebView; import android.widget.Toast; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdSize; import com.google.android.gms.ads.AdView; import com.google.android.gms.ads.MobileAds; import com.google.android.gms.ads.initialization.InitializationStatus; import com.google.android.gms.ads.initialization.OnInitializationCompleteListener; public class MainActivity extends AppCompatActivity {     WebView view;     AdView mAdview;     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         MobileAds.initialize(this, new OnInitializationCompleteListener() {             @Override             public void onInitializationComplete(InitializationStatus initializationStatus) {             }         });         mAdview = (AdView)findViewById(R.id.adView);         AdRequest adRequest = new AdRequest.Builder().build();         mAdview.loadAd(adRequest);         StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();         StrictMode.setVmPolicy(builder.build());         view = (WebView) this.findViewById(R.id.webView);         view.getSettings().setJavaScriptEnabled(true);         view.getSettings().setDatabaseEnabled(true);         view.getSettings().setDatabasePath("/data/data/" + view.getContext().getPackageName() + "/databases/");         view.getSettings().setDomStorageEnabled(true);         view.getSettings().setLoadsImagesAutomatically(true);         view.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);         view.loadUrl("file:///android_asset/test.html");     }     boolean doubleBackToExitPressedOnce = false;     @Override     public void onBackPressed() {         if (doubleBackToExitPressedOnce) {             new AlertDialog.Builder(this)                     .setTitle("Lotin-Kirill Converter.")                     .setMessage("Dasturdan chiqmoqchimisiz?")                     .setPositiveButton("Ha",                             new DialogInterface.OnClickListener() {                                 @Override                                 public void onClick(DialogInterface dialog,                                                     int which) {                                     finish();                                 }                             }).setNegativeButton("Yo'q", null).show();             return;         }         this.doubleBackToExitPressedOnce = true;         Toast.makeText(this, "Iltimos, Dasturdan chiqish uchun yana bir marta bosing!", Toast.LENGTH_SHORT).show();         new Handler().postDelayed(new Runnable() {             @Override             public void run() {                 doubleBackToExitPressedOnce=false;             }         }, 2000);     } } 

It is activity_main.xml

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     tools:context=".MainActivity">     <WebView         android:id="@+id/webView"         android:layout_width="fill_parent"         android:layout_height="fill_parent"         app:layout_constraintBottom_toBottomOf="parent"         app:layout_constraintEnd_toEndOf="parent"         app:layout_constraintStart_toStartOf="parent">     </WebView>     <com.google.android.gms.ads.AdView         android:id="@+id/adView"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignParentBottom="true"         android:layout_centerHorizontal="true"         app:adSize="BANNER"         app:adUnitId="ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx" /> </RelativeLayout> 

If you find my mistake, Please help me! Thank you for your attention!