Closed sommermarta closed 4 years ago
@sommermarta I believe you want to use the dfp_performCustomTargetingValueAction()
function to delete custom targeting values. Here is an example (make sure to update the query to your use case):
request_data <- list(customTargetingValueAction='DeleteCustomTargetingValues',
filterStatement=list('query'=paste0("WHERE name like 'Test%'")))
dfp_performCustomTargetingValueAction(request_data, as_df=FALSE)
https://github.com/StevenMMortimer/rdfp/blob/main/tests/testthat/test-CustomTargetingService.R#L78
You can also update existing custom targeting values using dfp_updateCustomTargetingValues()
, like this:
request_data <- data.frame(customTargetingKeyId=dfp_createCustomTargetingKeys_result$id,
id=dfp_createCustomTargetingValues_result$id[1],
name='TestValue1',
displayName='TestValue1A',
matchType='EXACT')
dfp_updateCustomTargetingValues(request_data)
I highly recommend taking a look at the test scripts if you need a specific example for how to format the request (https://github.com/StevenMMortimer/rdfp/tree/main/tests/testthat). They are organized by the Ad Manager service that they fall into (e.g. LabelService
, OrderService
, ReportService
, etc.). Anything you want to do with regards to custom targeting can be found in the file: https://github.com/StevenMMortimer/rdfp/blob/main/tests/testthat/test-CustomTargetingService.R
Also, reviewing the Google Documentation helps as well so you can get familiar with how they've structured the system (https://developers.google.com/ad-manager/api/start) although their link to the API documentation is down recently...
Thank you very much! It works :)
Hi, Steven!
At first, thank you very much for creating this great package! I have one question for which I could not find any answer myself. I am trying to delete some values from key value and I don't know how. Is there any easy way to modify
dfp_createCustomTargetingValues
function and force it to delete values?Thanks Marta