Posts under category google-ads-api

I have a Framework 4.8 C# app that uses ClearScript to allow JavaScript to be used as an extension language. I am able to write plugins as DLLs and attach them at runtime, viz

JSE.Script.attach = (Func<string, bool>)Attach; ...         private static bool Attach(string dllPath, string name = "")         {             var status = false;             var htc = new HostTypeCollection();             try             {                 var assem = Assembly.Load(AssemblyName.GetAssemblyName(dllPath));                 htc.AddAssembly(assem);                 if (name.Length == 0)                 {                     name = assem.FullName.Split(',')[0];                 }                 JSE.AddHostObject(name, htc); //FIXME checkout the hosttypes                 Console.Error.WriteLine($"Attached {dllPath} as {name}");                 status = true;             }             catch (ReflectionTypeLoadException rtle)             {                 foreach (var item in rtle.LoaderExceptions)                 {                     Console.Error.WriteLine(item.Message);                     T.Fail(item.Message);                 }             }             catch (FileNotFoundException fnfe)             {                 Console.Error.WriteLine(fnfe.Message);                 T.Fail(fnfe.Message);             }             catch (Exception e)             {                 Console.Error.WriteLine(e.Message);                 T.Fail(e.Message);             }             return status;         } 

This permits my scripts to have lines like

attach(".\\Plugin_GoogleAds_Metrics.dll"); H = Plugin_GoogleAds_Metrics.GoogleAds_Metrics.Historical; H.EnableTrace("GAM"); ... 

I've made a public repo of the plugin for those interested.

What's not working in this situation is that when I try to execute the plugin's GetAccountInformation method, and execution reaches the GoogleAdsServiceClient googleAdsService = client.GetService(Services.V11.GoogleAdsService); line, an error is thrown complaining about Google.Protobuf, viz

Exception has been thrown by the target of an invocation.     at JScript global code (Script [23] [temp]:5:0) -> acc = H.GetAccountInformation(auths.Item1, 7273576109, true)    at Microsoft.ClearScript.ScriptEngine.ThrowScriptError(IScriptEngineException scriptError)    at Microsoft.ClearScript.Windows.WindowsScriptEngine.ThrowScriptError(Exception exception)    at Microsoft.ClearScript.Windows.WindowsScriptEngine.<>c__DisplayClass57_0`1.<ScriptInvoke>b__0()    at Microsoft.ClearScript.ScriptEngine.ScriptInvokeInternal[T](Func`1 func)    at Microsoft.ClearScript.ScriptEngine.ScriptInvoke[T](Func`1 func)    at Microsoft.ClearScript.Windows.WindowsScriptEngine.ScriptInvoke[T](Func`1 func)    at Microsoft.ClearScript.Windows.WindowsScriptEngine.Execute(UniqueDocumentInfo documentInfo, String code, Boolean evaluate)    at Microsoft.ClearScript.Windows.JScriptEngine.Execute(UniqueDocumentInfo documentInfo, String code, Boolean evaluate)    at Microsoft.ClearScript.ScriptEngine.Evaluate(UniqueDocumentInfo documentInfo, String code, Boolean marshalResult)    at Microsoft.ClearScript.ScriptEngine.Evaluate(DocumentInfo documentInfo, String code)    at Microsoft.ClearScript.ScriptEngine.Evaluate(String documentName, Boolean discard, String code)    at Microsoft.ClearScript.ScriptEngine.Evaluate(String documentName, String code)    at Microsoft.ClearScript.ScriptEngine.Evaluate(String code)    at RulesetRunner.Program.Run(JScriptEngine& jSE, String scriptText, Config cfg, Dictionary`2 settings) in C:\Users\bugma\Source\Repos\Present\BORR\RulesetRunner\RunManagementPartials.cs:line 72 Exception has been thrown by the target of an invocation. Exception has been thrown by the target of an invocation. Could not load file or assembly 'Google.Protobuf, Version=3.15.8.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604' or one of its dependencies. The system cannot find the file specified. 

So

  1. I am using the latest Google.Ads.GoogleAds library
  2. AutoGenerateBindingRedirects has been set to true in the csproj file
  3. Add-BindingRedirect has been executed in the context of the Plugin's project
  4. The Plugin_GoogleAds_Metrics.dll is in the same folder as the Google.Protobuf.dll

Where to from here?

I am trying to use Data fusion to get detail report of my Google ads MCC level. I did the following

  1. Have a test developer account token on my MCC
  2. Generated the refresh token
  3. Generated the client ID & client secret
  4. Authorised Google ads API to access my account

I added all the needed credentials in the properties section but It gives me the following error Exception while downloading report definition :null

I think the problem is with the fields as I tried to add fields such as Clicks Ad_Name & Date but still getting the same error even after changing the fields over and over again. Any idea why this is happening?

I need some help.

As described in the Title, the Google AdsMob does not work properly.

I built the app according to the tutorial, however i receive the above mentioned error plist:

<key>GADApplicationIdentifier</key> <string>app id from google</string> 

Viewcontroller:

private let banner: GADBannerView = {     let banner = GADBannerView()     banner.adUnitID = Banner ID     banner.load(GADRequest())     banner.backgroundColor = .secondarySystemBackground     return banner }() viewDidLoad(){ banner.rootViewController = self         view.addSubview(banner) } 

It seems that it doesn't matter wether the banner.view is created or not. The app shows a black screen an error message is:

[I-ACS025031] AdMob App ID changed. Original, new: (nil),

I am working with a Macbook Air M1

In Google's Click Conversion object documentation, they do not describe the conversionValue parameter very well. They say it must be a numerical value. However, often times with numerical values in programming, there are some issues with numbers being passed that become floats and the precision can sometimes be lost, giving you an unexpected output compared to your input. For instance, in some eCommerce APIs, they want you to overcome this float problem by passing monetary values by multiplying the value by 100. So, let's say I want to pass '0.01' in this field. Is the API flexible enough if I pass it as 0.01 and not in a string? Or if I wrap it as a string like '0.01', will it automatically compute its numerical value with no float precision issue? Or, do I need to treat it like many eCommerce APIs and multiply it by 100 and pass it as (0.01*100) or 1?

I'm using the REST API for posting click conversions to Google Ads. I need to know how to specify the numerical value for conversionValue, and need to know that if I pass it as "0.01" as a double-quoted string in the JSON, if it will work or if it will compute it as zero because it wasn't a numerical value?

Note also that this SO article doesn't really answer because it's talking about the value as a tracking pixel version of posting the conversion to Google, and not a JSON API value used for posting offline conversions. It was interesting to note that this SO poster seemed to have some kind of proof that Google stores this value as a Double, although I don't see any documentation for this. I also don't know how the API treats a string of "0.01" when being passed to this value, and whether it converts it to 0.01 in a Double format in such a way that it won't lose precision on that data.

I'm developing an application for a client that needs to be hosted in one of their systems.
I already have a developer token and a functioning API but it has access to every ad account I own under my MCC.

I would like to have a token that only has access to a restricted subset of ad accounts, as I obviously cannot share my full token with the client.

I have already tried the service account authentication but it doesn't anwswer my needs.

edit: any tips on sharing secrets is welcome if the functionality is not natively supported by the API