Skip to content

AdSense dashboard error: e.replace is not a function #1092

@jamesozzie

Description

@jamesozzie

Users are encountering an e.replace is not a function error on their AdSense Site Kit dashboard.
e.replace is not a function

Reports only since the latest version of the plugin was released, users either updated or activated for first time. Occurs with AdSense module active only. More info below:

The following WordPress support threads all relate to this issue:

Possibly related to #1054 or #1066

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots

Screen Shot 2020-01-30 at 6 18 09 PM

Console Errors:
consoleErrors

Additional Context

  • Occurs since plugin update 1.2.0
  • Doesn't affect AdSense snippet (when already placed)
  • Primary SK dashboard works fine when AdSense module is disconnected
  • No identified plugins or hosting environments (waiting for more info from some users)
  • Clearing cache, purging CDN and incognito doesn't resolve
  • One Site Health info provided
Response Data
{
  "code": 400,
  "message": "Restricted metric(s): ga:adsenseRevenue, ga:adsensePageImpressions, ga:adsenseECPM can only be queried under certain conditions.\nFor details see https://developers.google.com/analytics/devguides/reporting/core/dimsmets.",
  "data": {
    "status": 500,
    "reason": "badRequest"
  }
}
{
  "modules::adsense::earnings::e6a23163cd3fc119c2c2dd7336409c78": {
    "averages": [
      "21.65",
      null,
      "53896"
    ],
    "endDate": "2020-02-02",
    "kind": "adsense#report",
    "rows": [
      [
        "21.65",
        "1.42",
        "53896"
      ]
    ],
    "startDate": "2020-02-02",
    "totalMatchedRows": "1",
    "totals": [
      "21.65",
      "1.42",
      "53896"
    ],
    "warnings": [
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions."
    ],
    "headers": [
      {
        "currency": "USD",
        "name": "EARNINGS",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": "USD",
        "name": "PAGE_VIEWS_RPM",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": null,
        "name": "IMPRESSIONS",
        "type": "METRIC_TALLY"
      }
    ]
  },
  "modules::adsense::earnings::a7be42621010ad758d66a22d67416f78": {
    "averages": [
      "34.56",
      null,
      "60236"
    ],
    "endDate": "2020-01-27",
    "kind": "adsense#report",
    "rows": [
      [
        "34.56",
        "1.49",
        "60236"
      ]
    ],
    "startDate": "2020-01-27",
    "totalMatchedRows": "1",
    "totals": [
      "34.56",
      "1.49",
      "60236"
    ],
    "warnings": [
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions."
    ],
    "headers": [
      {
        "currency": "USD",
        "name": "EARNINGS",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": "USD",
        "name": "PAGE_VIEWS_RPM",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": null,
        "name": "IMPRESSIONS",
        "type": "METRIC_TALLY"
      }
    ]
  },
  "modules::adsense::earnings::bc151ea9244a09b4178d2d1936dc272b": {
    "averages": [
      "304.49",
      null,
      "659383"
    ],
    "endDate": "2020-02-02",
    "kind": "adsense#report",
    "rows": [
      [
        "304.49",
        "1.36",
        "659383"
      ]
    ],
    "startDate": "2020-01-27",
    "totalMatchedRows": "1",
    "totals": [
      "304.49",
      "1.36",
      "659383"
    ],
    "warnings": [
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions."
    ],
    "headers": [
      {
        "currency": "USD",
        "name": "EARNINGS",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": "USD",
        "name": "PAGE_VIEWS_RPM",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": null,
        "name": "IMPRESSIONS",
        "type": "METRIC_TALLY"
      }
    ]
  },
  "modules::adsense::earnings::adba27fd336f62b657a1f1b81975c523": {
    "averages": [
      "815.91",
      null,
      "1339364"
    ],
    "endDate": "2020-01-26",
    "kind": "adsense#report",
    "rows": [
      [
        "815.91",
        "1.63",
        "1339364"
      ]
    ],
    "startDate": "2020-01-20",
    "totalMatchedRows": "1",
    "totals": [
      "815.91",
      "1.63",
      "1339364"
    ],
    "warnings": [
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions."
    ],
    "headers": [
      {
        "currency": "USD",
        "name": "EARNINGS",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": "USD",
        "name": "PAGE_VIEWS_RPM",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": null,
        "name": "IMPRESSIONS",
        "type": "METRIC_TALLY"
      }
    ]
  },
  "modules::adsense::earnings::8dda3739b67f9a5b10dc618ace6aea29": {
    "averages": [
      "67.03",
      null,
      "154774"
    ],
    "endDate": "2020-02-03",
    "kind": "adsense#report",
    "rows": [
      [
        "67.03",
        "1.53",
        "154774"
      ]
    ],
    "startDate": "2020-02-01",
    "totalMatchedRows": "1",
    "totals": [
      "67.03",
      "1.53",
      "154774"
    ],
    "warnings": [
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions."
    ],
    "headers": [
      {
        "currency": "USD",
        "name": "EARNINGS",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": "USD",
        "name": "PAGE_VIEWS_RPM",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": null,
        "name": "IMPRESSIONS",
        "type": "METRIC_TALLY"
      }
    ]
  },
  "modules::adsense::earnings::f56fc5b6762d70191c3423c0c34018dd": {
    "averages": [
      null,
      null,
      null
    ],
    "endDate": "2019-02-28",
    "kind": "adsense#report",
    "rows": null,
    "startDate": "2019-02-01",
    "totalMatchedRows": "0",
    "totals": [
      null,
      null,
      null
    ],
    "warnings": [
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions."
    ],
    "headers": [
      {
        "currency": "USD",
        "name": "EARNINGS",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": "USD",
        "name": "PAGE_VIEWS_RPM",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": null,
        "name": "IMPRESSIONS",
        "type": "METRIC_TALLY"
      }
    ]
  },
  "modules::adsense::earnings::4d624fc436160bc59afb173d2ea99e06": {
    "averages": [
      "1870.65",
      null,
      "1633670"
    ],
    "endDate": "2020-01-05",
    "kind": "adsense#report",
    "rows": [
      [
        "1870.65",
        "2.70",
        "1633670"
      ]
    ],
    "startDate": "2019-12-09",
    "totalMatchedRows": "1",
    "totals": [
      "1870.65",
      "2.70",
      "1633670"
    ],
    "warnings": [
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions.",
      "Some of the requested ad clients do not support the requested combination of dimensions."
    ],
    "headers": [
      {
        "currency": "USD",
        "name": "EARNINGS",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": "USD",
        "name": "PAGE_VIEWS_RPM",
        "type": "METRIC_CURRENCY"
      },
      {
        "currency": null,
        "name": "IMPRESSIONS",
        "type": "METRIC_TALLY"
      }
    ]
  }
}
  • PHP Version:
  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Plugin Version [e.g. 22]
  • Device: [e.g. iPhone6]

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The AdSense report dashboard should display properly for all users.

Implementation Brief

Changelog entry

  • Fix JavaScript error e.replace is not a function in AdSense screens related to formatting numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Group: EscalationIssues which requires escalationP0High priorityType: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions