I've build a own tracking template for Google ads, which looks like this:

http://tracking.example.com?lpurl={lpurl}

This tracking link (where {lpurl} is the final url) leads to our website and triggers the script below.

<?php     header("Status: 301 Moved Permanently"); // some code to add data to our database // then redirect traffic to url:     header("Location:".$_GET["lpurl"]."?". $_SERVER['QUERY_STRING']);     exit; ?> 

I have started using ClickPatrol.com for click fraud protection and PPC protection. However, they also require a tracking template. They work well with Hubspot, but I don't know how to combine their tracking template with mine and modify my script.

their trackingtemplate is: https://example.com/?uid=[unique id]&adp={adposition}&lpm={loc_physical_ms}&lim={loc_interest_ms}&adi={adgroupid}&k={keyword}&n={network}&ci={campaignid}&d={device}&p={placement}&u={lpurl}&ma={matchtype}&ta={target}&cr={creative}

Any idea how I can combine:

http://example.com?url={lpurl}

and

https://example.com/?uid=[unique id]&adp={adposition}&lpm={loc_physical_ms}&lim={loc_interest_ms}&adi={adgroupid}&k={keyword}&n={network}&ci={campaignid}&d={device}&p={placement}&u={lpurl}&ma={matchtype}&ta={target}&cr={creative}

I want to track my traffic with my own script and also use ClickPatrol

I attempted to merge the querystring and redirect it, but the urls in the querystring made it difficult to decode and encode, resulting in redirecting errors.

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 was doing coding in node js but in that it there is requirement of setup like that

APP_ID=<<YOUR-WHATSAPP-BUSINESS-APP_ID>> APP_SECRET=<<YOUR-WHATSAPP-BUSINESS-APP_SECRET>> RECIPIENT_WAID=<<YOUR-RECIPIENT-TEST-PHONE-NUMBER>> VERSION=v13.0 PHONE_NUMBER_ID=<<YOUR-WHATSAPP-BUSINESS-PHONE-NUMBER-ID>> ACCESS_TOKEN=<<YOUR-SYSTEM-USER-ACCESS-TOKEN>>   

I got all credential accept app_secret. I am unable to find that if anyone know how can I get app_secret please let me know.

Thanks in advance.

I searched on dashboard but couldn't find that.