To enable GTM to fire tags based on content or interactions in a Flash movie, the ActionScript External Interface API must be used to push Events and dynamic Page Variables to the dataLayer on the container page from the SWF movie.

To achieve this functionality, the GTM container code snippet should be implemented within the HTML of the SWF’s parent page. Events and dynamic Page Variables may then be pushed from the Flash component into GTM by calling the push() API via External Interface. For example, to trigger an Event upon click of a button (mybutton_btn) using ActionScript 3, you could implement the following code within your SWF:

import flash.display.*;


import flash.external.*; mybutton_btn.addEventListener(MouseEvent.MOUSE_UP, onButtonClick); function onButtonClick( Event:MouseEvent ):void {

var name:String= “FLASH_EVENT”; if (ExternalInterface.available) {‘dataLayer.push’,{‘event’: name}); }}


For the ExternalInterface API to function properly ensure that when embedding your SWF, script access is enabled:

<object classid=’clsid:D27CDB6E-AE6D-11cf-96B8-444553540000′ width=’300′ height=’300′ id=’player1′ name=’player1′> <param name=’movie’ value=’file.swf’> <param name=’allowfullscreen’ value=’true’> <param name=’allowscriptaccess’ value=’always’> <param name=’flashvars’ value=’file=playlist.xml’> <embed id=’player1′

name=’player1′ src=’file.swf’ width=’300′ height=’300′ allowscriptaccess=’always’ allowfullscreen=’true’ flashvars=”file=playlist.xml” /> </object>


0117 3361103