This API request stores and updates Google ad cost data for a specific site using the HTTP method PUT. The request includes the following parameters:
SiteId
stringRequiredThe ID of the site for which to add or update ad cost data
Authorization
stringRequired The authorization token for accessing the API. The header value should be set to "Bearer {your-access-token}", where {your-access-token}
is the access token assigned to the user.
The data containing the ad cost information to store or update. The payload should include the following parameters:
StartDate
stringRequiredThe start date for the report, must be in ISO 8601 format. yyyy-MM-dd
EndDate
stringRequiredThe end date for the report, must be in ISO 8601 format. yyyy-MM-dd
GoogleApiResponse
objectRequiredThe response object from the Google API.
GoogleApiResponse.customer
objectRequiredThe customer object from the Google API response.
GoogleApiResponse.customer.resourceName
stringRequiredThe resource name of the customer.
GoogleApiResponse.customer.descriptiveName
stringRequiredThe descriptive name of the customer.
GoogleApiResponse.customer.currencyCode
stringRequiredThe currency code used by the customer.
GoogleApiResponse.campaign
objectRequiredThe campaign object from the Google API response.
GoogleApiResponse.campaign.resourceName
stringRequiredThe resource name of the campaign.
GoogleApiResponse.campaign.status
stringRequiredThe status of the campaign.
GoogleApiResponse.campaign.advertisingChannelType
stringRequiredThe advertising channel type of the campaign.
GoogleApiResponse.campaign.name
stringRequiredThe name of the campaign.
GoogleApiResponse.adGroup
objectRequiredThe ad group object from the Google API response.
GoogleApiResponse.adGroup.resourceName
stringRequiredThe resource name of the ad group.
GoogleApiResponse.adGroup.name
stringRequiredThe name of the ad group.
GoogleApiResponse.metrics
objectRequiredThe metrics object from the Google API response.
GoogleApiResponse.metrics.clicks
stringRequiredThe number of clicks.
GoogleApiResponse.metrics.conversions
numberRequiredThe number of conversions.
GoogleApiResponse.metrics.costMicros
stringRequiredThe cost in micros.
GoogleApiResponse.metrics.costPerConversion
numberRequiredThe cost per conversion.
GoogleApiResponse.metrics.ctr
numberRequiredThe click-through rate.
GoogleApiResponse.adGroupCriterion
objectThe adGroupCriterion object from the Google API response.
GoogleApiResponse.adGroupCriterion.resourceName
numberThe resource name of the adGroupCriterion.
GoogleApiResponse.adGroupCriterion.keyword
objectThe adGroupCriterion.keyword object from the Google API response.
GoogleApiResponse.adGroupCriterion.keyword.text
stringThe keyword associated with the ad.
GoogleApiResponse.keywordView
objectThe keyword view object from the Google API response.
GoogleApiResponse.keywordView.resourceName
stringThe resource name for the keyword view
The {siteId}
parameter in the URL endpoint should be replaced with the appropriate ID for the site being updated, and the {your-access-token}
parameter in the authorization header should be replaced with the appropriate access token.
curl -X PUT \ 'https://rest.rulerapi.com/v1/{siteId}/adcosts/google' \ -H 'Authorization: Bearer {your-access-token}' \ -H 'Content-Type: application/json' \ -d '{ "StartDate": "{StartDate}", "EndDate": "{EndDate}", "GoogleApiResponse":{ "customer": { "resourceName": "{customer/resourceName}", "descriptiveName": "{customer/descriptiveName}", "currencyCode": "{customer/currencyCode}" }, "campaign": { "resourceName": "{campaign/resourceName}", "status": "{campaign/status}", "advertisingChannelType": "{campaign/advertisingChannelType}", "name": "{campaign/name}" }, "adGroup": { "resourceName": "{adGroup/resourceName}", "name": "{adGroup/name}" }, "metrics": { "clicks": "{metrics/clicks}", "conversions": "{metrics/conversions}", "costMicros": "{metrics/costMicros}", "costPerConversion": "{metrics/costPerConversion}", "ctr": "{metrics/ctr}", "averageCpc": "{metrics/averageCpc}", "impressions": "{metrics/impressions}", "videoViews": "{metrics/videoViews}" }, "adGroupCriterion": { "resourceName": "{adGroupCriterion/resourceName}", "keyword": { "text": "{adGroupCriterion/text}" } }, "keywordView": { "resourceName": "{keywordView/resourceName}" } } }'