Store/Update Google AdCosts

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:

Path Parameters:

SiteIdstringRequired

The ID of the site for which to add or update ad cost data

Headers:

AuthorizationstringRequired

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.

Request Body(JSON payload):

The data containing the ad cost information to store or update. The payload should include the following parameters:

StartDatestringRequired

The start date for the report, must be in ISO 8601 format. yyyy-MM-dd

EndDatestringRequired

The end date for the report, must be in ISO 8601 format. yyyy-MM-dd

GoogleApiResponseobjectRequired

The response object from the Google API.

GoogleApiResponse.customerobjectRequired

The customer object from the Google API response.

GoogleApiResponse.customer.resourceNamestringRequired

The resource name of the customer.

GoogleApiResponse.customer.descriptiveNamestringRequired

The descriptive name of the customer.

GoogleApiResponse.customer.currencyCodestringRequired

The currency code used by the customer.

GoogleApiResponse.campaignobjectRequired

The campaign object from the Google API response.

GoogleApiResponse.campaign.resourceNamestringRequired

The resource name of the campaign.

GoogleApiResponse.campaign.statusstringRequired

The status of the campaign.

GoogleApiResponse.campaign.advertisingChannelTypestringRequired

The advertising channel type of the campaign.

GoogleApiResponse.campaign.namestringRequired

The name of the campaign.

GoogleApiResponse.adGroupobjectRequired

The ad group object from the Google API response.

GoogleApiResponse.adGroup.resourceNamestringRequired

The resource name of the ad group.

GoogleApiResponse.adGroup.namestringRequired

The name of the ad group.

GoogleApiResponse.metricsobjectRequired

The metrics object from the Google API response.

GoogleApiResponse.metrics.clicksstringRequired

The number of clicks.

GoogleApiResponse.metrics.conversionsnumberRequired

The number of conversions.

GoogleApiResponse.metrics.costMicrosstringRequired

The cost in micros.

GoogleApiResponse.metrics.costPerConversionnumberRequired

The cost per conversion.

GoogleApiResponse.metrics.ctrnumberRequired

The click-through rate.

GoogleApiResponse.adGroupCriterionobject

The adGroupCriterion object from the Google API response.

GoogleApiResponse.adGroupCriterion.resourceNamenumber

The resource name of the adGroupCriterion.

GoogleApiResponse.adGroupCriterion.keywordobject

The adGroupCriterion.keyword object from the Google API response.

GoogleApiResponse.adGroupCriterion.keyword.textstring

The keyword associated with the ad.

GoogleApiResponse.keywordViewobject

The keyword view object from the Google API response.

GoogleApiResponse.keywordView.resourceNamestring

The 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.

Request
PUT
{siteId}/adcosts/google
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}" } } }'
Response
Status: 201