Posts under category google-ads-api

AdRequest adRequest = new AdRequest.Builder()                 .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)                 .build();         adView.loadAd(adRequest); 
ads:adSize="BANNER" 

ads code is errorring

This is the Code But .addTestDevice is erroring how can ı add addTestDevice This is the code thanks

I'm trying to send a google ads measurement conversion purchase event from my python backend.

I have the correct conversion lable and id.

class GoogleAds(Analytic): def __init__(self, data, shop_unique_id, event):     self.base_url = "https://www.googleadservices.com/pagead/conversion/{conversion_id}/"     super().__init__(data, shop_unique_id, event) def send_google_ads_event(self, payload):     try:         label = "label"         conversion_id = "id"         # for market in self.profile.markets:         #     if market_domain == market.domain:         #         ga4_measurement_id = market.ga4_measurement_id         #         ga4_api_secret = market.ga4_api_secret         if (             label != ""             and label is not None             and conversion_id != ""             and conversion_id is not None         ):             payload['conversion_id'] = conversion_id             payload['label'] = label             response = requests.get(self.base_url.format(conversion_id=conversion_id), params=payload)         # Check if the conversion was registered successfully         if response.status_code == 200 and response.headers.get('Content-Type') == 'image/gif':             log.info(                 "Finished sending data to Google ads",                 extra={                     "url": response.request.url,                     "sending_params": payload,                     "response_content_type": response.headers.get('Content-Type'),                     "status_code": response.status_code,                 },             )             return True         else:             log.error("Failed to send data to Google ads", extra={"status_code": response.status_code})             return False     except requests.RequestException as e:         log.error(f"Error sending data to Google ads: {e}")         return False 

This request returns status code 200, but on google ads measurements ui the count is still 0.

Payload looks like this

def purchase_data(webhook_data, shop_unique_id): transformed_items = [{     "id": item["product_id"],     "price": item["price"],     "quantity": item["quantity"] } for item in webhook_data["line_items"]] data = dict(     label="label",     value=float(webhook_data["total_price"]),     currency_code=webhook_data["currency"],     transaction_id=webhook_data["id"],     conversion_id="conversion_id",     items=transformed_items,     feed_country="GB",     merchant_id="merchant_id",     feed_language="GB" ) return data 

Any idea why that could be happening?

I am using Firebase Analytics (which is built on top of GA4 from what I understood), along with Google Ads.

I have set up some events in GA4 as conversions, for example when a user signup, then I use these conversions to optimize my Google Ads campaign. This works well!

I now want to track not only signups, but also purchases. I could track them from the frontend, but it sounds dodgy to do that on the client side: what if the user blocks GA? what if a user maliciously triggers the event multiple times to mess with my campaign?

So instead I want to log the purchase events from the backend. However, it's very important that they're still properly tied to the originating ad click, so that Google Ads can properly optimize my campaign.

I am looking for some ID that I could send from my frontend to my backend to identify the user (and therefore the ad click). But I can't seem to find anything. What am I missing?

I deployed inside a docker a reactjs project (optimized build).

I added the required scripts to enable Google ADS but I got following message

It doesn't find the ads.txt file, I put it under the /public folder and re-built and re-deployed the docker but nothing.. do you have any suggestion for it?

I made a playable ad and now i want to make a build for Mintegral platform. As the whole point of playable ad is to redirect user to store, i need to implement a CTA (call to action) method, that will do so. Every platform requires specific code to redirect user to store. And there is no much information about minegral code requirements. I found this recomendation on their website: The whole process of the playable needs a button for directing to Store, in order to make sure a button labeled “Download Now” can be shown all the time through the game and direct to Store. All features that direct to App Store must call API

window.install && window.install(); 

Is it all i hve to do for cta method? there is no specific url. May be i need to assign a url in their dashboard, not in the playable itself?

i tried to implenent this code as a cta method, but mintegral playable test site(https://www.mindworks-creative.com/review/) does not detect my method as a cta method.

onClick: function (store) {         window.install && window.install();            if (store === undefined)                store = navigator.userAgent.toLowerCase().indexOf("android") > -1 ? "google" : "apple";                var urls = {                "google": "https://play.google.com/store/apps/details?id=my id",                "apple": "https://apps.apple.com/us/app/my id"            };            var url = urls[store];            mraid.open(url);        }