iFrame Resizer - How to get it work

I understood from reading the Matomo docu that the I can embed Matomo widgets in iFrames. I am using it in WinterCMS’s Dasshboard. It works well if the Matoma widget is the last element in my dashboard but all others do not get resized. Interestingly enough, when I resize the browser window, everything gets resized.

Would anyone post code (WinterCMS uses the Bootstrap framework) that actually works? Currently my respective iFrameresizer call on the host looks like? My current code is along the lines

iFrameResize({
       log                     : true,                  // Enable console logging
       resizedCallback         : function(messageData){ // Callback fn when resize is received

       },
       messageCallback         : function(messageData){ // Callback fn when message is received

       },
       initCallback         : function(iframe){ // Callback fn when message is received

       },
       autoResize: true,
     
     }, "#<?= $matomoIdent ?>");

with <?= $matomoIdent ?> being different for every widget on my page.

The anser is:

<script>
  iFrameResize({
  	log                     : false,                  // Enable console logging
  	resizedCallback         : function(messageData){ // Callback fn when resize is received
      $(window).trigger('resize');
  	},
    tolerance: 10,
    heightCalculationMethod: 'lowestElement',
    interval: 500,
    bodyMargin: 0
  }, "#yourdivid");
</script>