You are here

santianoSEO

description

The SEO module by santiano.io gathers most commonly used variables by SEO such as Title, metaDescription, H1s, Canonical, HrefLang and Json TD rich snippets Tags,

Allowing you to send SEO custom variables to your favorite Web Analytics Tools.

setup

Please refer to the container setup instructions

gtm tags

santianoEvent - SEO - CanonicalUrl

santianoEvent - SEO - CanonicalUrl
Tag Type : Custom HTML
Sends a santianoEvent for detected issues with canonical URLs

  <script>
var seoTestUrlCurrentIsNotCanonical = {{seoCanonicalUrlNotMatchingCurrentUrl}};
var seoTestMissingCanonical = {{seoCanonicalUrlIsMissing}};
// moz has a good video for you here
// https://www.youtube.com/watch?v=1GX9KylnBtQ
// canonical tests
if (seoTestMissingCanonical) {
  dataLayer.push ({'event': 'santianoEvent',
                   'eventCommand': 'seoMonitoringCanonical',
                   'eventCategory': 'SEO Monitoring by santiano.io',
                   'eventAction': 'Page is missing its canonical',
                   'eventLabel': '{{seoUrlCurrent}}'
                   // 'eventSegment': undefined,
                   // 'eventPartition': undefined
                });
  
} else if (seoTestUrlCurrentIsNotCanonical) {
  dataLayer.push ({'event': 'santianoEvent',
                   'eventCommand': 'seoMonitoringCanonical',
                   'eventCategory': 'SEO Monitoring by santiano.io',
                   'eventAction': 'Page is not matching its canonical tag',
                   'eventLabel': '{{seoUrlCurrent}}'
                   // 'eventSegment': undefined,
                   // 'eventPartition': undefined
                });
}  

</script>
close
santianoEvent - SEO - HrefLang

santianoEvent - SEO - HrefLang
Tag Type : Custom HTML
Sends a santianoEvent for hrefLang issues found on the page

  <script>

// All the Hreflang tests are here 
var seoHrefLangHasNoXDefault = {{seoHrefLangHasNoXDefault}};
var seoHrefLangIsNotDefinedForOurPage = {{seoHrefLangIsNotDefinedForOurPage}};
  
// Individual Tests
if (seoHrefLangHasNoXDefault) {
  	dataLayer.push ({
      	'event': 'santianoEvent',
        'eventCommand': 'seoMonitoringHrefLang',
        'eventCategory': 'SEO Monitoring by santiano.io',
        'eventAction': 'HrefLang has no x-default',
        'eventLabel': '{{seoUrlCurrent}}'
        // 'eventSegment': undefined
        // 'eventPartition': undefined
    });  
}  
close
santianoEvent - SEO - MetaDescription

santianoEvent - SEO - MetaDescription
Tag Type : Custom HTML
Sends a santianoEvent for each metaDescription issue found

  <script>

// All the MetaDescription tests are here 
var seoMetaDescriptionIsTooLong = {{seoMetaDescriptionIsTooLong}};
var seoMetaDescriptionIsTooShort = {{seoMetaDescriptionIsTooShort}};
var seoMetaDescriptionIsMissing = {{seoMetaDescriptionIsMissing}};
  
// Individual Tests
if (seoMetaDescriptionIsMissing) {
  	dataLayer.push ({
      	'event': 'santianoEvent',
        'eventCommand': 'seoMonitoringTitleDescription',
        'eventCategory': 'SEO Monitoring by santiano.io',
        'eventAction': 'Meta Description is missing',
        'eventLabel': '{{seoUrlCurrent}}'
        // 'eventSegment': undefined
        // 'eventPartition': undefined
    });  
}  

if (seoMetaDescriptionIsTooShort) {
  	dataLayer.push ({
      	'event': 'santianoEvent',
        'eventCommand': 'seoMonitoringTitleDescription',
        'eventCategory': 'SEO Monitoring by santiano.io',
        'eventAction': 'Meta Description is too short',
        'eventLabel': '{{seoUrlCurrent}}'
        // 'eventSegment': undefined
        // 'eventPartition': undefined
    });  
}  

  
if (seoMetaDescriptionIsTooLong) {
  	dataLayer.push ({
      	'event': 'santianoEvent',
        'eventCommand': 'seoMonitoringTitleDescription',
        'eventCategory': 'SEO Monitoring by santiano.io',
        'eventAction': 'Meta Description is too long',
        'eventLabel': '{{seoUrlCurrent}}'
        // 'eventSegment': undefined
        // 'eventPartition': undefined
    });  
}    
</script>
close
santianoEvent - SEO - MetaRobots

santianoEvent - SEO - MetaRobots
Tag Type : Custom HTML
Sends a santianoEvent evrytime a page is set to nofollow or noindex

  <script>

var seoTestMetaRobotsIsNoFollow = {{seoMetaRobotsIsNoFollow}};
var seoTestMetaRobotsIsNoIndex = {{seoMetaRobotsIsNoIndex}};


// meta robots tests  
if (seoTestMetaRobotsIsNoFollow) {
  dataLayer.push ({'event': 'santianoEvent',
                   'eventCommand': 'seoMonitoringMetaRobots',
                   'eventCategory': 'SEO Monitoring by santiano.io',
                   'eventAction': 'Page is set to nofollow',
                   'eventLabel': {{seoUrlCurrent}}
                   // 'eventSegment': undefined,
                   // 'eventPartition': undefined
                });
  
}  
 
if (seoTestMetaRobotsIsNoIndex) {
  dataLayer.push ({'event': 'santianoEvent',
                   'eventCommand': 'seoMonitoringMetaRobots',
                   'eventCategory': 'SEO Monitoring by santiano.io',
                   'eventAction': 'Page is set to noindex',
                   'eventLabel': '{{seoUrlCurrent}}',
                   // 'eventSegment': undefined,
                   // 'eventPartition': undefined
                });
  
}  
</script>
close
santianoEvent - SEO - Title

santianoEvent - SEO - Title
Tag Type : Custom HTML
Sends a santianoEvent for issues found about the Title Tag on each page

  <script>

// Title monitoring events are here 
var seoTitleIsTooLong = {{seoTitleIsTooLong}};
var seoTitleIsMissing = {{seoTitleIsMissing}};

// meta robots tests  
if (seoTestTitleIsTooLong) {
  dataLayer.push ({'event': 'santianoEvent',
                   'eventCommand': 'seoMonitoringTitle',
                   'eventCategory': 'SEO Monitoring by santiano.io',
                   'eventAction': 'Title tag is too long',
                   'eventLabel': '{{seoUrlCurrent}}'
                   // 'eventSegment': undefined
                   // 'eventPartition': undefined
                });
  
}  
 
if (seoTitleIsMissing) {
  dataLayer.push ({'event': 'santianoEvent',
                   'eventCommand': 'seoMonitoringTitle',
                   'eventCategory': 'SEO Monitoring by santiano.io',
                   'eventAction': 'Title tag is missing',
                   'eventLabel': '{{seoUrlCurrent}}'
                   // 'eventSegment': undefined,
                   // 'eventPartition': undefined
                });
  
}  
</script>
close

gtm triggers

Event - santianoEvent - seoMonitoring

Event - santianoEvent - seoMonitoring
Trigger Type : Custom Event
Matches every santianoEvent related to seoMonitoring
Event Name : santianoEvent eventCommand starts with seoMonitoring

close
Variable - seoCanonicalUrlIsMissing

Variable - seoCanonicalUrlIsMissing
Trigger Type : Page View
it seems that the page is lacking is canonical tag
seoCanonicalUrlIsMissing equals true

close
Variable - seoCanonicalUrlIsNotMatchingCurrentUrl

Variable - seoCanonicalUrlIsNotMatchingCurrentUrl
Trigger Type : Page View
it seems current page is not the one indicated on the intended canonical tag
seoCanonicalUrlIsNotMatchingCurrentUrl equals true

close
Variable - seoHrefLangHasNoXDefault

Variable - seoHrefLangHasNoXDefault
Trigger Type : Page View
The Hreflang tag does not have a xdefault value
seoHrefLangHasNoXDefault equals true

close
Variable - seoHrefLangIsNotDefinedForOurPage

Variable - seoHrefLangIsNotDefinedForOurPage
Trigger Type : Page View
The current page is not defined in our HrefLang Tags
seoHrefLangIsNotDefinedForOurPage equals true

close
Variable - seoMetaDescriptionIsMissing

Variable - seoMetaDescriptionIsMissing
Trigger Type : Page View
Page is missing its metaDescription tag
seoMetaDescriptionIsMissing equals true

close
Variable - seoMetaDescriptionIsTooLong

Variable - seoMetaDescriptionIsTooLong
Trigger Type : Page View
This Meta Description is too long
seoMetaDescriptionIsTooLong equals true

close
Variable - seoMetaDescriptionIsTooShort

Variable - seoMetaDescriptionIsTooShort
Trigger Type : Page View
This meta Description is too short
seoMetaDescriptionIsTooShort equals true

close
Variable - seoMetaRobotsIsNoFollow

Variable - seoMetaRobotsIsNoFollow
Trigger Type : Page View
the page is set with nofollow in its robot meta Tag
seoMetaRobotsIsNoFollow equals true

close
Variable - seoMetaRobotsIsNoIndex

Variable - seoMetaRobotsIsNoIndex
Trigger Type : Page View
The page has noindex on its robots meta Tag
seoMetaRobotsIsNoIndex equals true

close
Variable - seoTitleIsMissing

Variable - seoTitleIsMissing
Trigger Type : Page View
This page is missing its Title Tag which is very bad for SEO, (Trust me.... please...)
seoTitleIsMissing equals true

close
Variable - seoTitleIsTooLong

Variable - seoTitleIsTooLong
Trigger Type : Page View
this title is too long it seems
seoTitleIsTooLong equals true

close

gtm variables

eventCommand

eventCommand
Variable Type : Data Layer Variable
santiano.io comes with its specific eventCommand : its naming scheme facilitates management and maintenance of events tags and ecommerce tags.

  Data Layer Variable Name  : eventCommand 
Data Layer Version : Version 2
close
santianoApacheV2.0Licence

santianoApacheV2.0Licence
Variable Type : Custom Javascript

    function() {
  // santiano.io is released under Apache V2.0 licence.
  // 
  // Copyright 2018 Santiano Consulting SAS (santiano.io)
  // 
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  // 
  // http://www.apache.org/licenses/LICENSE-2.0
  // 
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
    return 'santiano.io is released under Apache V2.0 licence';
  }
close
seoBrowserLanguage

seoBrowserLanguage
Variable Type : Javascript Variable
The language of the browser

  Global Variable Name : navigator.language
close
seoBrowserUserAgent

seoBrowserUserAgent
Variable Type : Javascript Variable
the user agent sent by the web browser

  Global Variable Name : navigator.userAgent
close
seoBrowserUserAgentIsGoogle

seoBrowserUserAgentIsGoogle
Variable Type : Custom Javascript
is this google visiting my site ? Big thanks to Matt Stannard for the help on that one https://twitter.com/mattstannard :) :) Feature not tested yet

  function() {
  // thanks Matt Stannard for this :)
  if (navigator.appName.indexOf("google") != -1) {
      return true;
  } else {
      return false;
  }
}
close
seoCanonicalUrl

seoCanonicalUrl
Variable Type : Custom Javascript
Grabing the congtent of the canonical tag

  function() {
	// grabing the content of that tag
	// <link rel="canonical" href="XXXXXXXXX" />
    var seoCanonicalUrl = document.querySelector('link[rel="canonical"]').href;
    return seoCanonicalUrl;
  }
close
seoCanonicalUrlIsMissing

seoCanonicalUrlIsMissing
Variable Type : Custom Javascript
Returning true if the page has no canonical

    function() {
    var seoUrlCanonical = {{seoCanonicalUrl}};
    if ( seoUrlCanonical == undefined) {
    	return true
    } else {
      	return false
    }
  }
close
seoCanonicalUrlNotMatchingCurrentUrl

seoCanonicalUrlNotMatchingCurrentUrl
Variable Type : Custom Javascript
It seems the visited page is not matching its canonical version, in SEO, this can be intended or not wanted. contact your SEO consultant about that.

    function() {
    var seoUrlCanonical = {{seoCanonicalUrl}};
    var seoUrlCurrent = {{seoUrlCurrent}};
    if ( seoUrlCanonical == seoUrlCurrent) {
    	return false
    } else {
      	return true
    }
  }
close
seoH1

seoH1
Variable Type : Custom Javascript
Grabing all H1 in the page a making an array with it if multiple, or just the content of the h1

  function() {
    var h1 = document.body.getElementsByTagName('h1');
  	var seoH1Numbers = {{seoH1Number}};
  	

	if( seoH1Numbers == 1) {
      	// one H1 was found
      	return h1[0].innerText
    } else if (seoH1Numbers > 1) {
      	// more than one H1 found
    	var i;
  		var h1List = [];
		for ( i = 0; i < seoH1Numbers; i++ ){
    		h1List.push(h1[i].innerText)
    	}
  		return h1List;
    } else {
    	return 'no H1 on page';
    }
}

close
seoH1Number

seoH1Number
Variable Type : Javascript Variable
Number of H1 found on the page. This can used to send a santianoEvent Tag for SEOmonitoring

  function() {
    var h1s = document.body.getElementsByTagName('h1');
	return h1s.length;
}
close
seoH2

seoH2
Variable Type : Custom Javascript
Grabs all H2 of the Page and makes an array with it

  function() {
    var h2 = document.body.getElementsByTagName('h2');
  	var seoH2Numbers = {{seoH2Number}};
  	
	if( seoH2Numbers == 1) {
      	// one H2 was found
      	return h2[0].innerText
    } else if (seoH2Numbers > 1) {
      	// more than one H2 found
    	var i;
  		var h2List = [];
		for ( i = 0; i < seoH2Numbers; i++ ){
    		h2List.push(h2[i].innerText)
    	}
  		return h2List;
    } else {
    	return 'no H2 on page';
    }
}

close
seoH2Number

seoH2Number
Variable Type : Custom Javascript
Provides the number of H2 Tags on the page

  function() {
    var h2s = document.body.getElementsByTagName('h2');
	return h2s.length;
}
close
seoHostname

seoHostname
Variable Type : Custom Javascript
Returns the hostname of the page being visited

    function() {
   return window.location.hostname;
  }
close
seoHrefLang

seoHrefLang
Variable Type : Custom Javascript
Grabs all hreflang tags in the page and makes a object with it

  function() {
  	// grabing the content of all hreflang tags
	// <link rel="alternate" hreflang="XXXXX" href="XXXXXX" />
	var linksInHead = document.head.getElementsByTagName('link');
  	var linksInHeadLength = linksInHead.length;
    var SEOHrefLang = [];
  	
  	var i;
    for ( i = 0; i < linksInHeadLength; i++ ) {
      	var hrefLang = '';
        var href = '';
    	if (linksInHead[i].rel == 'alternate' && linksInHead[i].hreflang != '') {
			hrefLang = linksInHead[i].hreflang ;
          	href = linksInHead[i].href ;
          	SEOHrefLang.push({ 'hreflang': hrefLang,
                               'href': href
                             })
          	
        }   
    }
  	return SEOHrefLang;
}
close
seoHrefLangAvailableVersions

seoHrefLangAvailableVersions
Variable Type : Custom Javascript
Provides a string of all language and Language-Geolocalised versions of this page

  function() {
  	var seoHrefLangIsDefined = {{seoHrefLangIsDefined}};

	if (seoHrefLangIsDefined) {
      	// the seed data
      	var seoHrefLang = {{seoHrefLang}};
      	var seoHrefLangLength = {{seoHrefLangLength}};
		// default result
      	var seoHrefLangAvailableVersions = [];
      	var i;
		for ( i = 0; i < seoHrefLangLength ; i++ ) {
          	if ( seoHrefLang[i].hreflang != 'x-default' ) {
              	seoHrefLangAvailableVersions.push(seoHrefLang[i].hreflang)
          	}
      	}
      	return seoHrefLangAvailableVersions.toString();
	} else {
		return undefined;
	}
}
close
seoHrefLangHasNoXDefault

seoHrefLangHasNoXDefault
Variable Type : Custom Javascript
It seems this hrefLang has no x-default url associated with it.

  function() {
  	var seoHrefLangIsDefined = {{seoHrefLangIsDefined}};

	if (seoHrefLangIsDefined) {
      	// the seed data
      	var seoHrefLang = {{seoHrefLang}};
      	var seoHrefLangLength = {{seoHrefLangLength}};
		// default result
      	var seoTestHrefLangHasNoXDefault = true;
      	var i;
		for ( i = 0; i < seoHrefLangLength ; i++ ) {
          	if ( seoHrefLang[i].hreflang == 'x-default' ) {
              	seoTestHrefLangHasNoXDefault = false;
          	}
      	}
      	return seoTestHrefLangHasNoXDefault;
	} else {
		return undefined;
	}
}
close
seoHrefLangIsDefined

seoHrefLangIsDefined
Variable Type : Custom Javascript
Do we have a HrefLang on that page ?

    function() {
    var seoHrefLang = {{seoHrefLang}};
    if (seoHrefLang.length > 0) {
    	return true;
    } else {
    	return false;
    }
  }
close
seoHrefLangIsNotDefinedForOurPage

seoHrefLangIsNotDefinedForOurPage
Variable Type : Custom Javascript
When Defined, HrefLangs must always report on the visited page, defining its URL and Language or Lang+Geo target. Almost exactly the same as a canonical

  function() {
  	var seoHrefLangIsDefined = {{seoHrefLangIsDefined}};

	if (seoHrefLangIsDefined) {
      	// the seed data
      	var seoHrefLang = {{seoHrefLang}};
      	var seoHrefLangLength = {{seoHrefLangLength}};
		var seoUrlCurrentStrippedParameter = {{seoUrlCurrentStrippedParameter}};
		// default result
      	var seoTestHrefLangIsNotDefinedForOurPage = true;
      	var i;
		for ( i = 0; i < seoHrefLangLength ; i++ ) {
          	if ( seoHrefLang[i].href == seoUrlCurrentStrippedParameter ) {
				seoTestHrefLangIsNotDefinedForOurPage = false
            }
      	}
      	return seoTestHrefLangIsNotDefinedForOurPage;
	} else {
		return undefined;
	}
}
close
seoHrefLangLength

seoHrefLangLength
Variable Type : Custom Javascript
Number of items in the seoHrefLang Variables

  function() {
  	var seoHrefLang = {{seoHrefLang}};
	return seoHrefLang.length;
}
close
seoLinksOnPage

seoLinksOnPage
Variable Type : Custom Javascript
Number of links as an array of objects on the page

  function() {
    var links = document.body.getElementsByTagName("a");
  	var linksNumber = links.length;
  	var seoHostname = {{seoHostname}}; // to check if the link is internal
	var seoMetaRobotsFollow = {{seoMetaRobotsFollow}};
	var seoUrlCurrent = {{seoUrlCurrent}};
	var seoLinksOnPage = [];
  	
  	var i;
    for ( i = 0; i < linksNumber; i++ ) {
      	
      	// is linkDestination internal or External ?
      	var linkHref = links[i].href.split('#')[0];
      	
      	if (linkHref != '' &&
            linkHref != undefined &&
            linkHref != seoUrlCurrent &&
            linkHref != seoUrlCurrent + '/' &&
            linkHref.indexOf('http') > -1) {
            
          	// will need to include the link type first
          	var linkAnchor = links[i].innerText;


            // is the link followed ?
          	if ( seoMetaRobotsFollow == 'nofollow') {
              	// remember that if nofollow is applied to the metaRobots Tag, all links are then nofollow
              	var linkFollowed = nofollow;
            } else {
              	// otherwise I look at the attribute itself
                var linkRelAttribute = links[i].rel;
                if (linkRelAttribute.indexOf('nofollow') != -1) {
                    linkFollowed = 'nofollow'
                } else {
                    linkFollowed = 'follow'
                }
            }
			
          	// if the target is empty the target is _self by default
            var linkTarget = links[i].target;
            if (linkTarget == '') {
                linkTarget = '_self'
            }
            // is linkDestination internal or External ?
            if ( linkHref.indexOf(seoHostname) == -1) {
            	var linkDestination = 'external'
            } else {
            	var linkDestination = 'internal'
            }


            seoLinksOnPage.push({'href': linkHref,
                                 'anchor': linkAnchor,
                                 'destination': linkDestination,
                                 'rel': linkFollowed,
                                 'target': linkTarget
                                })
        }
    }
  	return seoLinksOnPage;
}
close
seoLinksOnPageExternalFollowNumber

seoLinksOnPageExternalFollowNumber
Variable Type : Custom Javascript
Number of links on the page hat are external and followed

  function() {
    var seoLinksOnPage = {{seoLinksOnPage}};
	var seoLinksOnPageNumber = {{seoLinksOnPageNumber}};
	var seoLinksOnPageInternalNumber = 0;
	var i;
    for ( i = 0; i < seoLinksOnPageNumber; i++ ) {
      if (seoLinksOnPage[i].destination == 'external' && seoLinksOnPage[i].rel == 'follow') {
      	seoLinksOnPageInternalNumber++
      }
    }
    return seoLinksOnPageInternalNumber;
}
close
seoLinksOnPageExternalNoFollowNumber

seoLinksOnPageExternalNoFollowNumber
Variable Type : Custom Javascript
Number of external links on the page that are followed

  function() {
    var seoLinksOnPage = {{seoLinksOnPage}};
	var seoLinksOnPageNumber = {{seoLinksOnPageNumber}};
	var seoLinksOnPageInternalNumber = 0;
	var i;
    for ( i = 0; i < seoLinksOnPageNumber; i++ ) {
      if (seoLinksOnPage[i].destination == 'external' && seoLinksOnPage[i].rel == 'nofollow') {
      	seoLinksOnPageInternalNumber++
      }
    }
    return seoLinksOnPageInternalNumber;
}
close
seoLinksOnPageExternalNumber

seoLinksOnPageExternalNumber
Variable Type : Custom Javascript
Number of External links on that page

  function() {
    var seoLinksOnPage = {{seoLinksOnPage}};
	var seoLinksOnPageNumber = {{seoLinksOnPageNumber}};
	var seoLinksOnPageInternalNumber = 0;
	var i;
    for ( i = 0; i < seoLinksOnPageNumber; i++ ) {
      if (seoLinksOnPage[i].destination == 'external') {
      	seoLinksOnPageInternalNumber++
      }
    }
    return seoLinksOnPageInternalNumber;
}
close
seoLinksOnPageInternalFollowNumber

seoLinksOnPageInternalFollowNumber
Variable Type : Custom Javascript
Number of internal followed links on the page

  function() {
    var seoLinksOnPage = {{seoLinksOnPage}};
	var seoLinksOnPageNumber = {{seoLinksOnPageNumber}};
	var seoLinksOnPageInternalNumber = 0;
	var i;
    for ( i = 0; i < seoLinksOnPageNumber; i++ ) {
      if (seoLinksOnPage[i].destination == 'internal' && seoLinksOnPage[i].rel == 'follow') {
      	seoLinksOnPageInternalNumber++
      }
    }
    return seoLinksOnPageInternalNumber;
}
close
seoLinksOnPageInternalNoFollowNumber

seoLinksOnPageInternalNoFollowNumber
Variable Type : Custom Javascript
Number of internal noFollowed links on the page

  function() {
    var seoLinksOnPage = {{seoLinksOnPage}};
	var seoLinksOnPageNumber = {{seoLinksOnPageNumber}};
	var seoLinksOnPageInternalNumber = 0;
	var i;
    for ( i = 0; i < seoLinksOnPageNumber; i++ ) {
      if (seoLinksOnPage[i].destination == 'internal' && seoLinksOnPage[i].rel == 'nofollow') {
      	seoLinksOnPageInternalNumber++
      }
    }
    return seoLinksOnPageInternalNumber;
}
close
seoLinksOnPageInternalNumber

seoLinksOnPageInternalNumber
Variable Type : Custom Javascript
Number of internal links on the page

  function() {
    var seoLinksOnPage = {{seoLinksOnPage}};
	var seoLinksOnPageNumber = {{seoLinksOnPageNumber}};
	var seoLinksOnPageInternalNumber = 0;
	var i;
    for ( i = 0; i < seoLinksOnPageNumber; i++ ) {
      if (seoLinksOnPage[i].destination == 'internal') {
      	seoLinksOnPageInternalNumber++
      }
    }
    return seoLinksOnPageInternalNumber;
}
close
seoLinksOnPageNumber

seoLinksOnPageNumber
Variable Type : Custom Javascript
Number of links on the page

  function() {
    var seoLinksOnPage = {{seoLinksOnPage}};
    return seoLinksOnPage.length;
}
close
seoMetaDescription

seoMetaDescription
Variable Type : Custom Javascript
The content of the Meta Description Tag for that page

  function() {
	// grabing the content of that tag
	// <meta name="description" content="XXXXXXX" />
    var metaDescription = document.querySelector('meta[name="description"]').content;
    return metaDescription;
}

close
seoMetaDescriptionCurrentLength

seoMetaDescriptionCurrentLength
Variable Type : Custom Javascript
Length of the Meta Description Tag

  function() {
    var seoMetaDescription = {{seoMetaDescription}};
    return seoMetaDescription.length;
  }
close
seoMetaDescriptionIsMissing

seoMetaDescriptionIsMissing
Variable Type : Custom Javascript
Is the Meta Description is missing from that page ? returns true if that's the case

  function() {
    var seoMetaDescription = {{seoMetaDescription}};
    if ( seoMetaDescription == undefined) {
    	return true
    } else {
    	return false
    }
  }
close
seoMetaDescriptionIsTooLong

seoMetaDescriptionIsTooLong
Variable Type : Custom Javascript
Is the meta description too long according to Rand Fishkin himself ?

  function() {
    var seoMetaDescriptionMaxLength = {{seoMetaDescriptionMaxLength}};
	var seoMetaDescriptionCurrentLength = {{seoMetaDescriptionCurrentLength}};
	if (seoMetaDescriptionCurrentLength > seoMetaDescriptionMaxLength) {
    	return true
    } else {
    	return false
    }
}
close
seoMetaDescriptionIsTooShort

seoMetaDescriptionIsTooShort
Variable Type : Custom Javascript
Is the Meta Description on that page too short ? returning true if that's the case.

  function() {
    var seoMetaDescriptionMinLength = {{seoMetaDescriptionMinLength}};
	var seoMetaDescriptionCurrentLength = {{seoMetaDescriptionCurrentLength}};
	if (seoMetaDescriptionCurrentLength < seoMetaDescriptionMinLength) {
    	return true
    } else {
    	return false
    }
}

close
seoMetaDescriptionMaxLength

seoMetaDescriptionMaxLength
Variable Type : Custom Javascript
Max recommended length for the meta Description by MOZ

  function() {
    return 300;
}
close
seoMetaDescriptionMinLength

seoMetaDescriptionMinLength
Variable Type : Custom Javascript
What's the minimum number of characters in the Meta Description according to MOZ

  function() {
    return 50;
}
close
seoMetaRobots

seoMetaRobots
Variable Type : Dom Element
Content of the meta robots tag on the page

  Selection method : CSS Selector
Element Selector : meta[name=robots]
Attribute Name : content
close
seoMetaRobotsFollow

seoMetaRobotsFollow
Variable Type : Custom Javascript
Follow or NoFollow attribute of the page.

  function() {
 var seoMetaRobotsList = {{seoMetaRobots}}.split(', ');
 var seoMetaRobotsListLength = seoMetaRobotsList.length;
 var seoMetaRobotsFollow = 'follow';
 var i;

 for ( i = 0; i < seoMetaRobotsListLength; i++ ) {
   if ( seoMetaRobotsList[i] == 'nofollow' ) {
     seoMetaRobotsFollow = 'nofollow'
   }
 }
 return seoMetaRobotsFollow;
}
close
seoMetaRobotsIndex

seoMetaRobotsIndex
Variable Type : Custom Javascript
Index or NoIndex Attribute of the page

  function() {
 var seoMetaRobotsList = {{seoMetaRobots}}.split(', ');
 var seoMetaRobotsListLength = seoMetaRobotsList.length;
 var seoMetaRobotsIndex = 'index';
 var i;

 for ( i = 0; i < seoMetaRobotsListLength; i++ ) {
   if ( seoMetaRobotsList[i] == 'noindex' ) {
     seoMetaRobotsIndex = 'noindex'
   }
 }
 return seoMetaRobotsIndex;
}
close
seoMetaRobotsIsNoFollow

seoMetaRobotsIsNoFollow
Variable Type : Custom Javascript
When the page is set to nofollow, returns true

  function() {
  var seoMetaRobotsFollow = {{seoMetaRobotsFollow}};
  if ( seoMetaRobotsFollow == 'nofollow' ) {
  	return true;
  } else {
    return false
  }
}
close
seoMetaRobotsIsNoIndex

seoMetaRobotsIsNoIndex
Variable Type : Custom Javascript
If the page is set to No Index, returns true

  function() {
  var seoMetaRobotsIndex = {{seoMetaRobotsIndex}};
  if ( seoMetaRobotsIndex == 'noindex' ) {
  	return true;
  } else {
    return false
  }
}
close
seoRichSnippetAddressLocality

seoRichSnippetAddressLocality
Variable Type : Custom Javascript
Getting the content of the Json+LD variable address.locality

  function() {
    var richSnippetJsonLdObject = {{seoRichSnippetObject}};
    return richSnippetJsonLdObject.address.addressLocality;
}
close
seoRichSnippetAlternateName

seoRichSnippetAlternateName
Variable Type : Custom Javascript
Grabs the alternateName from the Json+LD rich snippets

  function() {
    var richSnippetJsonLdObject = {{seoRichSnippetObject}};
    return richSnippetJsonLdObject.alternateName;
}
close
seoRichSnippetLogo

seoRichSnippetLogo
Variable Type : Custom Javascript
Grabing the logo of the Json+LD rich snippet object on the page

  function() {
    var richSnippetJsonLdObject = {{seoRichSnippetObject}};
    return richSnippetJsonLdObject.logo;
}
close
seoRichSnippetName

seoRichSnippetName
Variable Type : Custom Javascript
Grabing the Name from the Json+LD rich snipet object

  function() {
    var richSnippetJsonLdObject = {{seoRichSnippetObject}};
    return richSnippetJsonLdObject.name;
}
close
seoRichSnippetObject

seoRichSnippetObject
Variable Type : Custom Javascript
Getting the full Json+LD object if any on the page

  function() {
	// grabing the content of that tag
	// <script type="application/ld+json">
    var jsonld = JSON.parse(document.querySelector('script[type="application/ld+json"]').innerText);
    return jsonld;
  }
close
seoRichSnippetStreetAddress

seoRichSnippetStreetAddress
Variable Type : Custom Javascript
Accessing the Street Address from the JSON+LD rich snippet object

  function() {
    var richSnippetJsonLdObject = {{seoRichSnippetObject}};
    return richSnippetJsonLdObject.address.streetAddress;
}
close
seoRichSnippetType

seoRichSnippetType
Variable Type : Custom Javascript
Getting to the @Type field in the JSON+LD rich snippet object

  function() {
    var richSnippetJsonLdObject = {{seoRichSnippetObject}};
    return richSnippetJsonLdObject['@type'];
}
close
seoRichSnippetUrl

seoRichSnippetUrl
Variable Type : Custom Javascript
Getting to the url inside the Json+LD rich snippet object

  function() {
    var richSnippetJsonLdObject = {{seoRichSnippetObject}};
    return richSnippetJsonLdObject.url;
}
close
seoTitle

seoTitle
Variable Type : Custom Javascript
Gets the content of the title Tag

  function() {
	// grabing the content of that tag
	// <title>XXXXXXXXXXXX</title>
    var metaTitle = document.head.getElementsByTagName('title')[0].innerText;
    return metaTitle;
  }

close
seoTitleCurrentLength

seoTitleCurrentLength
Variable Type : Custom Javascript
Getting the length of the Title Tag

  function() {
    var seoTitle = {{seoTitle}};
    return seoTitle.length;
  }
close
seoTitleIsMissing

seoTitleIsMissing
Variable Type : Custom Javascript
Returns true if the Title is missing on the page

  function() {
    var seoTitle = {{seoTitle}};
    if ( seoTitle == undefined) {
    	return true
    } else {
    	return false
    }
  }
close

Add comment

Download

older versions

	> extracting MetaDescription

Monitoring Canonicals