Questions tagged [google-ads-api]

Google Ads (formerly Google Adwords) is a method to advertise on Google search results. Use for questions related to the Google Ads API (which includes the frontend JavaScript client and backend REST API). Questions about how to use Google Ads itself (bidding strategies, keyword research, etc.) are off-topic.

Overview

Google Ads API is an interface for working with Google Ads platform, used for account, ads and bid management and reporting. The API provides a set of REST endpoints to communicate with, as well as gRPC interfaces.

References

  1. Google Ads API reference
  2. Guides for using with API
  3. Migration from AdWords API guide
  4. Client libraries for Ads API

Related Tags

2441 questions
71
votes
5 answers

How to track a Google Adwords conversion onclick?

Google Adwords offers no code to add to your page to count a conversion if somebody clicks on a link. But as it's Javascript, I am sure there is a way to do this. Here's the code (unaltered) Google gives you to include in the page, that should count…
janpio
  • 10,645
  • 16
  • 64
  • 107
55
votes
5 answers

Google AdWords: remove iframe added by tracking conversion code

I want to add Google AdWords to my site but the script I'm supposed to add creates an iframe in the dom. This iframe is visible and moves down 13px (its height) all my page. Is there any way to avoid this? If not, can I hide it without affecting…
Diego
  • 16,436
  • 26
  • 84
  • 136
54
votes
12 answers

Inserting Google Adwords Conversion Tracking with Javascript or jQuery

I'm pretty new to javascript, and therein probably lies my problem. I'm trying to track AdWords conversions that occur within a widget on our site. The user fills in a form and the result from the widget is published in the same div without a page…
Kevin Pope
  • 2,964
  • 5
  • 32
  • 47
44
votes
4 answers

Google Adwords CSP (content security policy) img-src

What domains/protocols in the img-src directive of the Content-Security-Policy header are required to allow Google AdWords conversion tracking? From testing, when we call google_trackConversion, it looks like the browser creates an image with a src…
Michal Charemza
  • 25,940
  • 14
  • 98
  • 165
42
votes
4 answers

How to capture if a visitor is from a google adwords click

When a user signs up on my site I want to be able to store whether or not they came to my site via an Adwords campaign. I know google uses javascript to track conversions based on a cookie that is created on the users machine. Is there a way I can…
CeejeeB
  • 3,034
  • 4
  • 25
  • 32
40
votes
7 answers

Refresh a Div that has a Google ad inside it

I have a
that holds a google ad. My website is mostly AJAX and there is no need for a browser refresh. That means my ads will not refresh either, which isn't ideal, a user staring at one ad all day. So I wanted a way to refresh a particular…
Abs
  • 56,052
  • 101
  • 275
  • 409
33
votes
4 answers

After updating Google Ads SDK addTestDevice is deprecated, How to resolve?

After updating Google Ads SDK to 19.0.0 gives a deprecated warning message for addTestDevice(), while I searched this link for resolving the issue but not succeed. how can I resolve it? Here my code mAdView.loadAd(new RequestConfiguration.Builder …
Attaullah
  • 3,856
  • 3
  • 48
  • 63
25
votes
11 answers

How to decode google gclids

Now, I realise the initial response to this is likely to be "you can't" or "use analytics", but I'll continue in the hope that someone has more insight than that. Google adwords with "autotagging" appends a "gclid" (presumably "google click id") to…
Draemon
  • 33,955
  • 16
  • 77
  • 104
23
votes
12 answers

Ads SDK was initialized without an application ID

Terminating app due to uncaught exception 'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK was initialized without an application ID. Google AdMob publishers, follow instructions here:…
Ali Raza
  • 1,183
  • 1
  • 10
  • 15
22
votes
5 answers

ModuleNotFoundError: No module named 'google_auth_oauthlib'

I am trying to run the 'generate_refresh_token.py' file in the authentification folder of the AdWords API. But when I do python generate_refresh_token.py as described in the documentation, I get the error ModuleNotFoundError: No module named…
Thomas
  • 422
  • 1
  • 4
  • 12
21
votes
4 answers

How to implement a Google Adwords "conversion pixel" using ajax on a submit button (no "thank you" page)

I want to implement an adwords "conversion pixel" script - this is the script: