Learn R Programming

googleAnalyticsR (version 1.2.0)

ga_remarketing_create: Create a new remarketing audience

Description

Create a remarketing audiences built via ga_remarketing_build

Usage

ga_remarketing_create(
  adwordsLinkId,
  include,
  exclude = NULL,
  audienceType = c("SIMPLE", "STATE_BASED"),
  name = NULL
)

Arguments

adwordsLinkId

The adwords link to add the remarketing audience to

include

A ga4_remarketing_segment object to include via ga_remarketing_build

exclude

If audienceType="STATE_BASED", a ga4_remarketing_segment object to exclude via ga_remarketing_build

audienceType

SIMPLE or STATE_BASED

name

An optional name, if not supplied one will be generated

Details

This builds and calls the API to create the remarketing audience based on the segments you have defined.

See Also

Other remarketing management functions: ga_remarketing_build(), ga_remarketing_estimate(), ga_remarketing_get(), ga_remarketing_list()

Examples

Run this code

if (FALSE) {
adword_list <- ga_adwords_list(123456, "UA-123456-1")

adword_link <- ga_adword(adword_list$id[[1]])

segment_list <- ga_segment_list()$items$definition

my_remarketing1 <- ga_remarketing_build(segment_list[[1]], 
                    state_duration = "TEMPORARY",
                    membershipDurationDays = 90, 
                    daysToLookBack = 14)
                    
my_remarketing2 <- ga_remarketing_build(segment_list[[2]], 
                     state_duration = "PERMANENT",
                     membershipDurationDays = 7, 
                     daysToLookBack = 31)
                     
# state based only can include exclusions
ga_remarketing_create(adwords_link = adword_link,
                     include = my_remarketing1, 
                     exclude = my_remarketing2,
                     audienceType = "STATE_BASED", 
                     name = "my_remarketing_seg1")

}

Run the code above in your browser using DataLab