Posts tagged with adsense

I'm need to get GCLID value inside my android app. What i found is Play Install Referrer Library, that returns me a utm tags, but i'm not sure that GCLID value will be inside val referrer = response.installReferrer

Code sample:

 fun getGCLID(){         referrerClient = InstallReferrerClient.newBuilder(this).build()         referrerClient.startConnection(object : InstallReferrerStateListener {             override fun onInstallReferrerSetupFinished(responseCode: Int) {                 when (responseCode) {                     InstallReferrerClient.InstallReferrerResponse.OK -> {                         // Connection established.                         val response: ReferrerDetails = referrerClient.installReferrer                         val referrer = response.installReferrer                         val clickTimestamp = response.referrerClickTimestampSeconds                         val installTimestamp = response.installBeginTimestampSeconds                         Log.d("TagGCLID", "onInstallReferrerSetupFinished: 1")                         if ("gclid" in referrer) {                             Log.d("TagGCLID", "GCLID is detected in referrer // is $referrer")                             //report to Firebase Analytics                         } else {                             Log.d("TagGCLID", "no GCLID is detected in referrer\n" +                                     "$referrer")                             //do something else                         }                     }                     InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED -> {                         Log.d("TagGCLID", "InstallReferrerResponse: -1")                         // API not available on the current Play Store app.                     }                     InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE -> {                         Log.d("TagGCLID", "InstallReferrerResponse: -2")                         // Connection couldn't be established.                     }                 }             }             override fun onInstallReferrerServiceDisconnected() {                 Log.d("TagGCLID", "onInstallReferrerServiceDisconnected: -3")                 // Try to restart the connection on the next request to                 // Google Play by calling the startConnection() method.             }         })     } 

What i'm suppose to do to get GCLID value?

When user don't have an internet connection i want to show a black fullscreen popup that include like

"you should open your internet to use this app"

or

"no internet connection found please open it"

every minutes for show my google ads; and popup will countdown from 5 second for close the popup.

And i don't want to be banned from google ads because of illegal behaviours.

Is it forbidden or illegal with google ads policy, i didn't see any information about this on google ads docs?

If you go to my website https://iclintz.com/ and go to inspect and click on the mobile phone simulator and scroll down a little bit first, a google ad appears at the top, when you scroll back up to the very top, there is some padding that has been added and clicking on minimise on the google ad keeps the padding there. This issue is happening on all phones. I could not figure out why this is happening and there are no errors regarding this in the console log.

Screenshot here:

Any ideas for the cause of the issue or potential fixes? I've seen other sites that use google auto ads, but they do not suffer from the same problem.