SOLVED: Using EntryMetada for ComScore Integration




I am trying to map Custom Metadata variables from a Metadata Profile to some ComScore variables. using the ComScore Streaming Tag Plugin.

These are my labelMappings:

		"labelMapping": "c3=\"xxxxxxxxxx\",c4=*null,c6=*null,ns_st_st={mediaProxy.entryMetadata.Ns_st_st},ns_st_pu={mediaProxy.entryMetadata.PublisherBrandName},ns_st_pr={mediaProxy.entryMetadata.ProgramTitle},ns_st_ep={},ns_st_sn={mediaProxy.entryMetadata.EpisodeSeasonNumber}, ns_st_en={mediaProxy.entryMetadata.EpisodeNumber},ns_st_ge={mediaProxy.entryMetadata.ContentGenre},ns_st_ti= {mediaProxy.entryMetadata.TMSGracenodeID},ns_st_ia={mediaProxy.entryMetadata.AdLoadFlag},ns_st_ce={mediaProxy.entryMetadata.CompleteEpisodeFlag},ns_st_ddt={mediaProxy.entryMetadata.DigitalAirdate},ns_st_tdt={mediaProxy.entryMetadata.TVAirdate}"

Happens that none of the fields mapped get sent to ComScore. If I just replace the mediaProxy labels with a string, they do work.

I wonder is I am using the mediaProxy labels correctly. These labels come from a Custom Metadata Scheme which I have defined.

Any help would be appreciated


Felipe Borrero
Operations Director
Calipso Comunicaciones S.A.


Found the problem

All Mapped tags must be enclosed in double quotes and the quotes must be escaped like this:


Now I have a new problem. Some of the tags are dates but when I use the mediaProxy for them, I get the date formatted in UnixTime. Is there any way of formatting those values through the mediaProxy api?


Solved Again

When getting metadata values through the mediaProxy, you can apply some formating to the valĂșes with a pie to the formats available on this link:

But, I needed the date format to be YYYY-MM-YY so I had to create a custom format by including a custom Javascript as explained in:

This the JavaScript for the custom format:

                'YYMDdate': function( value ){
                        if (!!value) {
                                var d = new Date(Number(value)*1000);
                                return d.getFullYear()+'-'+(d.getMonth()+1).toString().padStart(2,'0')+'-'+d.getDate().toString().padStart(2,'0');
                        else {
                                return value;

In order to use the format, you should call it like {mediaProxy.entryMetadata.custom_value|YYMDdate} and you get your date as YYYY-MM-DD.

You may add as many formats as you want using the same register function and providing the proper Javascript for each option.

Hope this help someone.


Felipe Borrero
Operations Director
Calipso Comunicaciones S.A.