ads-search-api-documents

Conversion Tracking

What is “Conversion”?

Conversion is the number of users who clicked on an Ads and performed some “result” action.
By measuring this, you can see how well your Ads is performing.
For details, refer to the help below.
Conversion Analytics

How to operate from Search Ads API

Search Ads API uses ConversionTrackerService, to get, add and update conversion tracker information.
By using this service, you can get the number of conversions from the advertisements displayed in search advertisements, and you can check how well the advertisements are performing.
The conversion tag is shared with the ad management tool and API.

Sample Scenario

Company A sells Product B for 10,000 yen. Create a conversion tracker to track conversions on your web page.

                                                                                                                  
ItemValueExplain
categoryPURCHASEConversion tracker info categories
conversionTrackerName(Name it easy to understand)Name of Conversion Tracker
conversionTrackerTypeWEB_CONVERSIONType of Conversion
measurementPeriod30Conversion measurement period(● days)
statusENABLEDStatus of Conversion Tracker Information
userRevenueValue10000Sales of one conversion when the sales amount is fixed(● yen)※Value of Product B
markupLanguage(webConversion)HTMLMarkup language used to write snippets
trackingCodeType(webConversion)WEBPAGEWeb page tracking type


1. Add Conversion Tracker Information

At first, add Conversion Tracker Information with ConversionTrackerService:add.

Request sample
{
  "accountId": 111111,
  "operand": [
    {
      "category": "PURCHASE",
      "conversionTrackerName": "Pro_B_CV",
      "conversionTrackerType": "WEB_CONVERSION",
      "measurementPeriod": 30,
      "status": "ENABLED",
      "userRevenueValue": "10000",
      "webConversion": {
        "markupLanguage": "HTML",
        "trackingCodeType": "WEBPAGE"
      }
    }
  ]
}
Response sample

※Check for Response of snippet and advancedSnippet with ConversionTrackerService:get.

{
    "errors": null,
    "rid": "f7eaf398417b6eea34b1274ce683469d",
    "rval": {
        "values": [
            {
                "conversionTracker": {
                    "accountId": 111111,
                    "allConversionValue": null,
                    "allConversions": null,
                    "appConversion": null,
                    "category": "PURCHASE",
                    "conversionCountingType": "MANY_PER_CLICK",
                    "conversionTrackerId": 222222,
                    "conversionTrackerName": "Pro_B_CV",
                    "conversionTrackerType": "WEB_CONVERSION",
                    "conversionValue": null,
                    "conversions": null,
                    "excludeFromBidding": "FALSE",
                    "measurementPeriod": 30,
                    "mostRecentConversionDate": null,
                    "status": "ENABLED",
                    "userRevenueValue": "10000",
                    "webConversion": {
                        "markupLanguage": "HTML",
                        "snippet": null,
                        "advancedSnippet": null,
                        "trackingCodeType": "WEBPAGE"
                    }
                },
                "errors": null,
                "operationSucceeded": true
            }
        ]
    }
}


2. Get comversion tags to measure

Get comversion tags to measure with ConversionTrackerService:get.
※Check Conversion measurement tag (snippet or advancedSnippet) here.
※Then you use advancedSnippet, you need site general tag. For details, refer to the help below.
Conversion Analytics

Request sample
{
  "accountId": 111111,
  "conversionTrackerIds": [
    222222
  ],
  "numberResults": 1,
  "startIndex": 1,
  "statuses": [
    "ENABLED"
  ],
  "trackingCodeTypes": [
    "WEBPAGE"
  ]
}
Response sample
{
    "errors": null,
    "rid": "180b348e3630b1feef3a9ef24546e488",
    "rval": {
        "totalAllConversionValue": "0",
        "totalAllConversions": 0,
        "totalConversionValue": "0",
        "totalConversions": 0,
        "totalNumEntries": 1,
        "values": [
            {
                "conversionTracker": {
                    "accountId": 111111,
                    "allConversionValue": null,
                    "allConversions": null,
                    "appConversion": null,
                    "category": "PURCHASE",
                    "conversionCountingType": "MANY_PER_CLICK",
                    "conversionTrackerId": 222222,
                    "conversionTrackerName": "Pro_B_CV",
                    "conversionTrackerType": "WEB_CONVERSION",
                    "conversionValue": null,
                    "conversions": null,
                    "excludeFromBidding": "FALSE",
                    "measurementPeriod": 30,
                    "mostRecentConversionDate": null,
                    "status": "ENABLED",
                    "userRevenueValue": "10000",
                    "webConversion": {
                        "markupLanguage": "HTML",
                        "snippet": "<!-- Yahoo Code for your Conversion Page -->\n<script type=\"text/javascript\">\n    /* <![CDATA[ */\n    var yahoo_conversion_id = 1000000407;\n    var yahoo_conversion_label = \"S7vjCPKvk9oBEJ7fgOQD\";\n    var yahoo_conversion_value = 10000;\n    /* ]]> */\n</script>\n<script type=\"text/javascript\" src=\"https://s.yimg.jp/images/listing/tool/cv/conversion.js\">\n</script>\n<noscript>\n    <div style=\"display:inline;\">\n        <img height=\"1\" width=\"1\" style=\"border-style:none;\" alt=\"\" src=\"https://b91.yahoo.co.jp/pagead/conversion/1000000407/?value=10000&label=S7vjCPKvk9oBEJ7fgOQD&guid=ON&script=0&disvt=true\"/>\n    </div>\n</noscript>",
                        "advancedSnippet": "<script async>\nytag({\n  \"type\": \"yss_conversion\",\n  \"config\": {\n    \"yahoo_conversion_id\": \"1000000407\",\n    \"yahoo_conversion_label\": \"S7vjCPKvk9oBEJ7fgOQD\",\n    \"yahoo_conversion_value\": \"10000\"\n  }\n});\n</script>",
                        "trackingCodeType": "WEBPAGE"
                    }
                },
                "errors": null,
                "operationSucceeded": true
            }
        ]
    }
}


3. Add tags into website and start to measure conversion

Add tags of snippet or advancedSnippet into website.

4. Get conversion measured

Get conversion measured with ConversionTrackerService:get.

Request sample
{
  "accountId": 111111,
  "conversionTrackerIds": [
    222222
  ],
  "numberResults": 1,
  "startIndex": 1,
  "statuses": [
    "ENABLED"
  ],
  "trackingCodeTypes": [
    "WEBPAGE"
  ]
}
Response sample
{
    "errors": null,
    "rid": "180b348e3630b1feef3a9ef24546e488",
    "rval": {
        "totalAllConversionValue": "10000000",
        "totalAllConversions": 1000,
        "totalConversionValue": "100000000",
        "totalConversions": 10000,
        "totalNumEntries": 1,
        "values": [
            {
                "conversionTracker": {
                    "accountId": 111111,
                    "allConversionValue": 10000000,
                    "allConversions": 1000,
                    "appConversion": null,
                    "category": "PURCHASE",
                    "conversionCountingType": "MANY_PER_CLICK",
                    "conversionTrackerId": 222222,
                    "conversionTrackerName": "Pro_B_CV",
                    "conversionTrackerType": "WEB_CONVERSION",
                    "conversionValue": 100000000,
                    "conversions": 10000,
                    "excludeFromBidding": "FALSE",
                    "measurementPeriod": 30,
                    "mostRecentConversionDate": null,
                    "status": "ENABLED",
                    "userRevenueValue": "10000",
                    "webConversion": {
                        "markupLanguage": "HTML",
                        "snippet": "<!-- Yahoo Code for your Conversion Page -->\n<script type=\"text/javascript\">\n    /* <![CDATA[ */\n    var yahoo_conversion_id = 1000000407;\n    var yahoo_conversion_label = \"S7vjCPKvk9oBEJ7fgOQD\";\n    var yahoo_conversion_value = 10000;\n    /* ]]> */\n</script>\n<script type=\"text/javascript\" src=\"https://s.yimg.jp/images/listing/tool/cv/conversion.js\">\n</script>\n<noscript>\n    <div style=\"display:inline;\">\n        <img height=\"1\" width=\"1\" style=\"border-style:none;\" alt=\"\" src=\"https://b91.yahoo.co.jp/pagead/conversion/1000000407/?value=10000&label=S7vjCPKvk9oBEJ7fgOQD&guid=ON&script=0&disvt=true\"/>\n    </div>\n</noscript>",
                        "advancedSnippet": "<script async>\nytag({\n  \"type\": \"yss_conversion\",\n  \"config\": {\n    \"yahoo_conversion_id\": \"1000000407\",\n    \"yahoo_conversion_label\": \"S7vjCPKvk9oBEJ7fgOQD\",\n    \"yahoo_conversion_value\": \"10000\"\n  }\n});\n</script>",
                        "trackingCodeType": "WEBPAGE"
                    }
                },
                "errors": null,
                "operationSucceeded": true
            }
        ]
    }
}


5. Set Conversion Tracker Information

Set Conversion Tracker Information which were added with ConversionTrackerService:set.
In the following, Set category of Conversion Tracker Information from PURCHASE to PAGE_VIEW.

Request sample
{
  "accountId": 111111,
  "operand": [
    {
      "category": "PAGE_VIEW",
      "conversionTrackerId": 222222,
      "conversionTrackerType": "WEB_CONVERSION"
    }
  ]
}
Response sample
{
    "errors": null,
    "rid": "5b5d34b5cd8238352127e418b2b4bacb",
    "rval": {
        "values": [
            {
                "conversionTracker": {
                    "accountId": 111111,
                    "allConversionValue": 10000000,
                    "allConversions": 1000,
                    "appConversion": null,
                    "category": "PAGE_VIEW",
                    "conversionCountingType": "MANY_PER_CLICK",
                    "conversionTrackerId": 222222,
                    "conversionTrackerName": "Pro_B_CV",
                    "conversionTrackerType": "WEB_CONVERSION",
                    "conversionValue": 100000000,
                    "conversions": 10000,
                    "excludeFromBidding": "FALSE",
                    "measurementPeriod": 30,
                    "mostRecentConversionDate": null,
                    "status": "ENABLED",
                    "userRevenueValue": "10000",
                    "webConversion": {
                        "markupLanguage": "HTML",
                        "snippet": "<!-- Yahoo Code for your Conversion Page -->\n<script type=\"text/javascript\">\n    /* <![CDATA[ */\n    var yahoo_conversion_id = 1000000407;\n    var yahoo_conversion_label = \"S7vjCPKvk9oBEJ7fgOQD\";\n    var yahoo_conversion_value = 10000;\n    /* ]]> */\n</script>\n<script type=\"text/javascript\" src=\"https://s.yimg.jp/images/listing/tool/cv/conversion.js\">\n</script>\n<noscript>\n    <div style=\"display:inline;\">\n        <img height=\"1\" width=\"1\" style=\"border-style:none;\" alt=\"\" src=\"https://b91.yahoo.co.jp/pagead/conversion/1000000407/?value=10000&label=S7vjCPKvk9oBEJ7fgOQD&guid=ON&script=0&disvt=true\"/>\n    </div>\n</noscript>",
                        "advancedSnippet": "<script async>\nytag({\n  \"type\": \"yss_conversion\",\n  \"config\": {\n    \"yahoo_conversion_id\": \"1000000407\",\n    \"yahoo_conversion_label\": \"S7vjCPKvk9oBEJ7fgOQD\",\n    \"yahoo_conversion_value\": \"10000\"\n  }\n});\n</script>",
                        "trackingCodeType": "WEBPAGE"
                    }
                },
                "errors": null,
                "operationSucceeded": true
            }
        ]
    }
}