Prerequisites

Adobe IO API Configuration

  1. Get System Admin rights for Adobe IO

  2. Generate public certificate and private key per https://helpx.adobe.com/in/marketing-cloud-core/kb/adobe-io-authentication-step-by-step.html:

    • Generate secret.pem and certificate.pem via:
      bash openssl req -nodes -text -x509 -newkey rsa:2048 -keyout secret.pem -out certificate.pem -days 356

    • Convert secret.key to secret.pem via:

    bash openssl pkcs8 -topk8 -inform PEM -outform DER -in secret.pem -nocrypt > secret.key 1. Set up New Integration in Adobe IO: Go to https://console.adobe.io > "New Integration" > "Access and API" > select Adobe Solution (Target) > Enter Integration details > Upload certificate.pem

  3. Use adobeTaRget::set_adobe_io_credentials() to set credentials --- or manually populate .Renviron with the following from the IO Console and the directory where you saved secret.pem:

    adobe_io_ims_host = ims-na1.adobelogin.com adobe_io_ims_endpoint_jwt = /ims/exchange/jwt adobe_io_org_id = xxx@AdobeOrg adobe_io_api_key = xxx adobe_io_client_secret = xxx adobe_io_tech_acct_id = xxx@techacct.adobe.com adobe_io_priv_key_filename = xxx/secret.pem


Usage

Get stats and paradata for activities

library(adobeTaRget)
library(dplyr)
exchangeJWTforBearerToken()

# List Activities
activities <- listActivities() %>% filter(grepl("AA Test", name)) %>% select(-thirdPartyId)
activityId <- activities$id

# start = manual start datetime; startsAt = scheduled start
activities

# Get AB Performance Report (using Adobe Target API)
getAbPerformanceReport(activityId)

# Get report for more metrics and breakdowns using RSiteCatalyst under the hood
library(RSiteCatalyst)
RSiteCatalyst::SCAuth(key = Sys.getenv("SCAUTH_KEY"), secret = Sys.getenv("SCAUTH_SECRET"), company = Sys.getenv("SCAUTH_CO"))
adobeTaRget::QueueA4TReport(activityId = "298487") %>%
  mutate(activity = "AB",
         experience = c("A", "B"),
         uniquevisitors = c(12345, 54321)
         ) 

# View Changelog
getActivityChangelog(activityId, activities)

# Get AB Report Interval
getAbReportInterval(activityId)

Get and modify offer info

offers <- sapply(getAbActivityById("301540")$options, function(x) {setNames(x$offerId, x$name)})
offers

getOfferById(offers[2]) 

updateOfferById(offers[2], names(offers[2]), "<b>new content</b>")


derring-do/adobeTaRget documentation built on March 17, 2021, 5:24 a.m.