Posts tagged with google-ads-api

The application worked fine for half a year, I tried to upload an update, everything was as usual, but the console received "We have determined your app contains code to facilitate Ad Fraud", although I almost did not change anything. The only change that had at least some relation to the advertisement, after the splash, an advertisement appears, after it is closed, it shows the main screen of the application, it was decided to extend the display time of the splash screen, so a slight delay was added so that the advertisement had a little more time to load. After that, the update failed. We wrote in support, after almost 2 weeks, they replied:

"I’ve reviewed your appeal request and found that your app still violates Google Play Policy. I’ve included details below about the specific issue with your app and what you can do to get your app back on Google Play.

Step 1: Fix the policy violation with your app

During review, we found that your app violates the Ad fraud policy:

Your app is not compliant with the Ad Fraud policy. Ad fraud is strictly prohibited. Ad interactions generated for the purpose of tricking an ad network into believing traffic is from authentic user interest is ad fraud, which is a form of invalid traffic.

Ads should not be shown in a way that results in inadvertent clicks. Forcing a user to click an ad or submit personal information for advertising purposes before they can fully use an app is prohibited. Ads should not appear after the user has exited the app, or after the user has pressed the back button to exit the app. Ads associated with your app must not interfere with other apps, ads, or the operation of the device, including system or device buttons and ports.

This includes overlays, companion functionality, and widgetized ad units. Ads must only be displayed within the app serving them. You can refer the attached screenshot for additional information.

You can read through the Ad Fraud policy page for more details and examples of common violations.

Please update your app to fix this issue. You may also want to double check that your app complies with all other Developer Program Policies, as additional enforcement could occur if there are further policy violations.

Step 2: Submit an update to your app

To submit an updated app bundle or APK:

Prepare your updates. Create a new release using the compliant app bundle or APK. Be sure to create the new release on the same track(s) as the non-compliant app bundle or APK, increment the version number, and set the release to 100% rollout. Follow the on-screen instructions to add APKs or app bundles, then review and roll out your release. Please let me know if you have any other questions. Thanks for working with us to fix the policy issue and for your continued support of Google Play."

It seems like the application does not break anything, but I came across this answer Uncaught exception thrown by finalizer: All WebView methods must be called on the same thread. (Expected Looper ) th / 57308639 # 57308639 it is possible if the application is minimized and the advertisement is loaded and is shown not in the application. Or, due to problems with the connection, it does not show ads immediately after the splash, but passes it to the main screen and then it already shows that it also seems to be wrong, but then problems with the update appeared earlier. Could any of this be a problem? What else could be the problem? Maybe someone did something similar, please tell me what are the solutions?

Suddenly We are experiencing crashes when loading Ads from Google Ads SDK. The crash is coming on Android 9 running devices and having latest chrome version.87.0.4280.101

Ad SDK used:

implementation 'com.google.android.gms:play-services-ads-lite:19.6.0' 

The crash is only reported on the Google play console and not on Firebase Crashlytics.

This seems to be an issue of webview which is used internally by Google Ad SDK.

Anybody else is getting the same crashes recently..

Logs attached.

2020-12-12 10:42:35.79221819-21819/? A/DEBUG: Build fingerprint: 'xiaomi/lavender/lavender:9/PKQ1.180904.001/V10.3.5.0.PFGINXM:user/release-keys' 2020-12-12 10:42:35.79221819-21819/? A/DEBUG: Revision: '0' 2020-12-12 10:42:35.79221819-21819/? A/DEBUG: ABI: 'arm64' 2020-12-12 10:42:35.79221819-21819/? A/DEBUG: pid: 21385, tid: 21549, name: ThreadPoolForeg  >>> com.indiamart.m <<< 2020-12-12 10:42:35.79221819-21819/? A/DEBUG: signal 5 (SIGTRAP), code -6 (SI_TKILL), fault addr -------- 2020-12-12 10:42:35.79221819-21819/? A/DEBUG: Abort message: '[FATAL:jni_android.cc(249)] Please include Java exception stack in crash report     ' 2020-12-12 10:42:35.79221819-21819/? A/DEBUG:     x0  0000000000000000  x1  0000000000000081  x2  000000007fffffff  x3  0000000000000000 2020-12-12 10:42:35.79221819-21819/? A/DEBUG:     x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  7f7f7f7fffff7f7f 2020-12-12 10:42:35.79221819-21819/? A/DEBUG:     x8  0000000000000000  x9  0000000000000000  x10 0000000000000001  x11 0000000000000000 2020-12-12 10:42:35.79221819-21819/? A/DEBUG:     x12 00000000ffffff80  x13 ffffffffffffffff  x14 ffffffffff000000  x15 ffffffffffffffff 2020-12-12 10:42:35.79321819-21819/? A/DEBUG:     x16 0000007737c11218  x17 0000007737b21450  x18 0000000000000010  x19 0000007685e06c98 2020-12-12 10:42:35.79321819-21819/? A/DEBUG:     x20 0000007685e06cb0  x21 0000007685e06ca8  x22 000000000000004f  x23 0000007737c133c0 2020-12-12 10:42:35.79321819-21819/? A/DEBUG:     x24 00000076a20c8000  x25 0000007685e07588  x26 0000000000000000  x27 0000007685e067e8 2020-12-12 10:42:35.79321819-21819/? A/DEBUG:     x28 0000000000000000  x29 0000007685e06c30 2020-12-12 10:42:35.79321819-21819/? A/DEBUG:     sp  0000007685e067d0  lr  000000769f8dd854  pc  000000769f8dda34 2020-12-12 10:42:35.81421819-21819/? A/DEBUG: backtrace: 2020-12-12 10:42:35.81521819-21819/? A/DEBUG:     #00 pc 0000000001ab6a34  /data/app/com.android.chrome-SDEgJLhE8mN6xW_77wZdEQ==/base.apk (offset 0xd27000) 

I am trying to do the pagination with google-ads-php at the bottom of my page in php, so I get through my ads, like PREVIOUS 1,2,3 NEXT So this is my code:

    public function runExample(GoogleAdsClient $googleAdsClient, int $customerId){         $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();         // Creates a query that retrieves all ads.         $query = "SELECT campaign.name, ad_group.name, "             . "ad_group_ad.ad.responsive_display_ad.marketing_images, "             . "ad_group_ad.ad.app_ad.images, ad_group_ad.ad.app_ad.youtube_videos, "             . "ad_group_ad.ad.responsive_display_ad.youtube_videos, ad_group_ad.ad.local_ad.videos, "             . "ad_group_ad.ad.video_responsive_ad.videos, ad_group_ad.ad.video_ad.media_file,  "             . "ad_group_ad.ad.app_engagement_ad.images, ad_group_ad.ad.app_engagement_ad.videos, "             . "ad_group_ad.ad.display_upload_ad.media_bundle, ad_group_ad.ad.gmail_ad.product_images, "             . "ad_group_ad.ad.gmail_ad.product_videos, ad_group_ad.ad.gmail_ad.teaser.logo_image, "             . "ad_group_ad.ad.image_ad.image_url, ad_group_ad.ad.legacy_responsive_display_ad.square_marketing_image, "             . "ad_group_ad.ad.local_ad.marketing_images, ad_group_ad.ad.responsive_display_ad.logo_images, "             . "ad_group_ad.ad.responsive_display_ad.square_logo_images, "             . "ad_group_ad.ad.responsive_display_ad.square_marketing_images, "             . "ad_group_ad.ad.responsive_display_ad.youtube_videos, "             . "metrics.impressions, campaign.campaign_budget, campaign.status, "             . "campaign.start_date, campaign.end_date, metrics.all_conversions, "             . "metrics.average_cost, ad_group_ad.ad.type, ad_group_ad.ad.id, "             . "campaign.campaign_budget, metrics.cost_micros, ad_group_ad.status, metrics.impressions "             . "FROM ad_group_ad "             . "WHERE segments.date >= '{$this->from}' AND segments.date <= '{$this->to}' "             . "ORDER BY campaign.name ASC";         // Issues a search stream request.         /** @var GoogleAdsServerStreamDecorator $stream */         $stream = $googleAdsServiceClient->search($customerId, $query, ['pageSize' => 10]);         $ads = [];         foreach ($stream->iterateAllElements() as $googleAdsRow) {             dump($googleAdsRow->serializeToJsonString());             /** @var GoogleAdsRow $googleAdsRow */             $ads[] = json_decode($googleAdsRow->serializeToJsonString(), true);         } 

As you see the pageSize is set to 10, so it will be 23 pages, because I have 230 ads.

How can I do the pagination, now the $stream returns all ads in one response. How can return only 10 ads, and then when user click for example second page button, it will return the next 10 ads, and so on?

Thanks in advance!

I implemented a custom script in tankyou page in my woocommerce store to track google ads conversions. This is my implementation:

add_action( "woocommerce_thankyou", "pixel_analytics_conversion_track_script", 20 ); if ( ! function_exists( 'pixel_analytics_conversion_track_script' ) ) {     function pixel_analytics_conversion_track_script($order_id){         if ( $order_id > 0 ) {             $order = wc_get_order( $order_id );             if ( $order instanceof WC_Order ) {                 $order_id               = $order->get_id(); // order id                 $order_key              = $order->get_order_key(); // order key                 $order_total            = $order->get_total(); // order total                 $order_currency         = $order->get_currency(); // order currency                 $order_payment_method   = $order->get_payment_method(); // order payment method                 $order_shipping_country = $order->get_shipping_country(); // order shipping country                 $order_billing_country  = $order->get_billing_country(); // order billing country                 $order_status           = $order->get_status(); // order status                 ?>                 <script type="text/javascript">                     jQuery(document).ready(function( $ ){                         console.log('PURCHACE EVENT');                         /* Track conversion on facebook Pixel */                         fbq('track', 'Purchase',                         {                             value: <?php echo $order_total ?>,                             currency: "<?php echo $order_currency ?>"                         });                                              /* Track conversion on Google Ads */                         gtag('event', 'conversion',                          {                              'send_to': 'AW-693771414/0MhwCMa9rLYBEJa56MoC',                              'value': <?php echo $order_total ?>,                              'currency': "<?php echo $order_currency ?>",                              'transaction_id': "<?php echo $order_id ?>"                         });                     });                 </script>                 <?php             }         }     } } 

The code works very well but some data is not precise and I think that probably the code above duplicates conversion if user goes to thank you page twice. We have an order confirmation email that has a link to the thankyou page of woocommerce.

As you can see Im sending the transaction_id parameter, so my question:

If the user loads twice or N times the thank you page the conversion will appear dupplicated in Google ads even if you send the transaction_id parameter?