Smartocto datalayer setup

You can provide additional information about your stories to enrich data to generate valuable notifications.

The information in the datalayer can contain -but is not limited to- information about the author(s) of the story, section of the story, tags about the story, and whether a story is a premium (paid) or not.

In order to have the information sent to smartocto, the smartocto Tentacles script must be added to your website.

For clients that have implemented the smartocto Insights script, the _ain object can be used as a datalayer since it already contains the required meta-data. In that case please make sure that the Insights script loads before the Tentacles script on all article pages.

Please consult our Support team if you need more information.

Content of the datalayer

We recommend naming the datalayer _ain, adding the following information:

{
"postid": "[unique ID of the story]",
"title": "[title of the story]",
"url": "[canonical URL of the story, without any additional paramaters]"
"pubdate": "[publish timestamp in ISO 8601 format: 2021-12-31T10:30:00+02:00]",
"article_type": "[article type: article, story, news, blog, gallery, video...]",
"access_level": "[indicates the type of article, it can be free or paid]",
"authors": "[author name or comma-seperated names if more authors are signed]",
"sections": "[Level1>Level2>Level3]",
"tags": "[comma-separated list of story tags/keywords]",
"has_video": [true if story contains one or more videos, false if no video is added],
"updateTimestamp": "[last update timestamp in ISO 8601 format: 2021-12-31T10:35:00+02:00]",
}

All values must be of string type.

Required parameters

Here is the minimum set of required parameters for processing the story through the datalayer:

  • postid
  • title
  • url
  • pubdate
  • access_level

For optimal performance a few additional parameters should be added:

  • authors
  • sections
  • tags
  • article_type
  • has_video
  • updateTimestamp

Example

{
"postid": "sd98ds9",
"title": "PSV Eindhoven wins Champions League",
"url": "https://www.domain.name/category/story-title/sd98ds9/",
"pubdate": "2021-12-31T10:30:00+02:00",
"article_type": "article",
"authors": "John Doe,Jane Jameson",
"sections": "Sports>Soccer>Champions League",
"tags": "soccer,champions league,psv",
"access_level": "free"
"has_video": true,
"updateTimestamp": "2021-12-31T10:35:00+02:00",
}

 

Loading the datalayer object

To limit the sent and processed information to stories, it’s important that the smartocto datalayer is loaded and filled on story pages before the Tentacles script is loaded.

Please contact our Support team if you have any additional questions or concerns.