Tag manager by google 

  
Good morning guys,

I needed to insert a script right after the body, before the dynamic code generated by the OutSystems.
Is there any way to do this? 

Thank you, 
greetings
Hi Miguel,

We've recently introduced an API to include javascript code in several locations of the page, incluting right after the body tag. ( ‘HeadTop’, ‘HeadBottom’, ‘BodyTop’, ‘BodyBottom’)

Check out this extension:



Create an entry per script (one API call). Maybe it's a good idea to create a backoffice to manage all scripts.
You can create exceptions for eSpaces or applications in which you don't wan't to run the script.

I hope it helps!

Best regards,
Hélio Dolores



 Hi Hélio,

Thank you! 

Can i use this extension in version 7? 

Best regards,
Miguel Vicente


Hi again Miguel,

Unforntunatelly this API appeared in version 8.0.
Can't you just insert a script tag in the header of the page?

<script type="text/javascript" async="" src="http://www.google-analytics.com/ga.js"></script>

You can do this with the HTTPRequestHandler extension:



Unfortunately in 7.0 you don't have much flexibility on this.

Regards,
Hélio Dolores


 Hi Hélio,

In this particular case it had to be just below the body but I will try to migrate to version 8.

Thanks a lot for your help,

Regards,
Miguel Vicente

Miguel,

Just a quick note, this feature (Platform Extensibility API) is not available in the previous 8.0 Community Edition. 
It is available on the new Personal Environments and all (I think!) 8.0 Enterprises.

Regards,
HD

Hi Miguel,

I don't know the exact requirements of the script you're trying to use, but it may be sufficient to place it in an expresson with Escape Content set to No in the beginning of the page, or if you're using a Layout_Normal block to setup the page's layout, in the beginning of that block (so it gets propagated to all the pages that use it).

Cheers,
Miguel
Hi Miguel,

I had already tried that but without success because it had to be just below the body tag.
This is only to not appear warnings.

Thanks,

Cheers,
Miguel

This action Script_CreateOrUpdate create on every espace, any reason for outsystems do that and how to include the script just on espace that uses it?

Hi Filipe,

The easiest way to include a script in all screens of a single eSpace is to add it to the Layout blocks that are used throughout the whole application.

If you want a script to be shared among more eSpaces, you should place it in a webblock of its own and include that block in the Layout blocks of all the eSpaces you want the script to be in.

This way you're adding the script only where you deem necessary.

The IncludeJavascript API was designed with the opposite mindset (add everywhere, exclude when necessary).

Hi Filipe,


have a look at this component, it does everthing that you want..  


https://www.outsystems.com/forge/component/1555/javascriptmanager/


Martin