Variations in Script Tags

Variations in Script Tags counts how many times your keyword’s variations appear inside <script> elements in a page’s raw HTML. It is a diagnostic compatibility signal, not a target to optimize — script contents are code and data, not user-facing prose, so a high count relates to position within a result set but does not make a page rank.

Factor IDRG-KWD-078
FamilyKeyword Usage & Density
MeasurementVariation occurrence count
Measured zoneRaw script contents

What it measures

This factor counts keyword variations that occur inside <script> elements in the raw HTML. Rather than reading the visible text of a page, it looks at what sits between opening and closing script tags — the JavaScript, inline data, and other code a browser would execute rather than display — and tallies how often variations of the target keyword appear there.

How RankGear measures it

RankGear parses the capture group two between recognized script tags from the unstripped source, leaves the contents raw, and counts case-insensitive whole-word variation matches. In other words, it isolates the exact bytes between each script tag’s open and close — without stripping, decoding, or normalizing them — and matches variations against that raw text, ignoring letter case and requiring whole-word boundaries.

What RankGear looks for

<script type="application/ld+json">
  { "name": "keyword variation appears here", ... }   ← capture group 2 (raw, counted)
</script>

<script>
  var label = "another keyword variation";           ← capture group 2 (raw, counted)
</script>

How to optimize it

Do not optimize scripts for keyword relevance. Write maintainable code, and place user-facing topical information in the visible content of the page where readers and crawlers expect it. Treat this factor as an observation about what happens to be present in your script blocks, not a number to push up — stuffing keywords into JavaScript or JSON adds no value to a reader and does not make a page rank.

Important considerations

  • JavaScript strings, JSON, and code identifiers can all contribute to the count — a variable name or a data field that echoes your keyword is counted the same as prose would be.
  • The value can reflect application data rather than deliberate wording; a template that renders product names or labels into inline JSON will raise the count on its own.
  • Minification changes matching behavior, because it rewrites identifiers and collapses whitespace, altering which whole-word matches survive.
  • Treat this as a diagnostic compatibility signal. Correlation is not causation — the count relates to position within a measured result set and does not guarantee or cause a ranking.

Related factors

Part of the Factors reference · how RankGear measures · glossary.