Jump to content

google rich media result check


IFMkey

Recommended Posts

This is because we didn't update theme on our demo site for a long time. Now we fixed it, you can check it now:

Screenshot(3).png.b7d2c0e6aed0af9cb3a56996f876ab9c.png

 

All new theme version already have this. If you don't have it on your project, you need to add the following code into Website UI -> Page components -> include_header_general.tpl anywhere under <head> section:

	{{if $storage.video_view_video_view.video_id>0}}
		{{assign var="duration_hours" value=$storage.video_view_video_view.duration_minutes/60|intval}}
		{{assign var="duration_minutes" value=$storage.video_view_video_view.duration_minutes-$duration_hours*60}}
		{{assign var="duration_seconds" value=$storage.video_view_video_view.duration_seconds}}

		<script type="application/ld+json">
			{
				"@context": "https://schema.org",
				"@type": "VideoObject",
				"name": "{{$storage.video_view_video_view.title|json_encode|trim:'"'}}",
				"description": "{{$storage.video_view_video_view.description|default:$storage.video_view_video_view.title|json_encode|trim:'"'}}",
				"thumbnailUrl": "{{$storage.video_view_video_view.preview_url}}",
				"uploadDate": "{{$storage.video_view_video_view.post_date|date_format:"%Y-%m-%d"}}",
				"duration": "PT{{$duration_hours}}H{{$duration_minutes}}M{{$duration_seconds}}S",
				{{assign var="postfix" value=$lang.videos.sitemap_format_standard}}
				{{if $storage.video_view_video_view.is_private==2}}
					{{assign var="postfix" value=$lang.videos.sitemap_format_premium}}
				{{/if}}
				{{if $storage.video_view_video_view.formats[$postfix].file_url!=''}}
					"contentUrl": "{{$storage.video_view_video_view.formats[$postfix].file_url}}",
				{{else}}
					"embedUrl": "{{$config.project_url}}/embed/{{$storage.video_view_video_view.video_id}}",
				{{/if}}
				"interactionStatistic": [
					{
						"@type": "InteractionCounter",
						"interactionType": "http://schema.org/WatchAction",
						"userInteractionCount": "{{$storage.video_view_video_view.video_viewed}}"
					},
					{
						"@type": "InteractionCounter",
						"interactionType": "http://schema.org/LikeAction",
						"userInteractionCount": "{{$storage.video_view_video_view.rating_amount}}"
					}
				]
			}
		</script>
	{{/if}}

 

Link to comment
Share on other sites

  • 1 year later...

Hello. 

Could you please help with "uploadDate" format?

I need it in this format (required by google)

<meta itemprop="uploadDate" content="2016-03-31T08:00:00+08:00" />

Now i have this code 

"uploadDate": "{{$storage.video_view_video_view.post_date|date_format:"%Y-%m-%d"}}",

 

Wait help!

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Dear friends

How can i remove final slash in contentURL ??

Now i have this in "include_header_general.tpl"

<link itemprop="contentUrl" href="{{$video_file_url}}">

and paints something like this

<link itemprop="contentUrl" href="https://www.MYDOMAIN.COM/get_file/3/94f0ce6fc03278abc939eb5bc3dba097/0/963/963.mp4/">

and i would like THIS: 

<link itemprop="contentUrl" href="https://www.MYDOMAIN.COM/get_file/3/94f0ce6fc03278abc939eb5bc3dba097/0/963/963.mp4">

(without final "/" after .mp4)

 

Wait answer :)

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...