Jump to content
Search Community

Adding ClickTags in animateCC

Mustana test
Moderator Tag

Go to solution Solved by fripi,

Recommended Posts

  • 2 weeks later...
  • Solution

You can export the default template and edit it to add an <a href tag around the canvas zone, and also add the needed clicktag codes in header, then just use that new template for all your animations (publish setting > more setting > html/js tab > export/import new)

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

1. Export Default HTML Template

 

File > Publish Settings...  > HTML/JS  > Export  > Save  > Cancel

 

2. Rename exported Default HTML Template

 

Default Template.html  > MyTemplate1.html

3. Edit and save MyTemplate1.html

 

<!DOCTYPE html>
<!--
    NOTES:
    1. All tokens are represented by '$' sign in the template.
    2. You can write your code only wherever mentioned.
    3. All occurrences of existing tokens will be replaced by their appropriate values.
    4. Blank lines will be removed automatically.
    5. Remove unnecessary comments before creating your template.
-->
<html>
<head>
<meta charset="UTF-8">
<meta name="authoring-tool" content="$VERSION">
<title>$TITLE</title>
<!-- write your code here -->

<meta name="ad.size" content="width=$WT,height=$HT">
<script src="https://s0.2mdn.net/ads/studio/cached_libs/createjs_2019.11.15_min.js"></script>

<script>var clickTag = "https://www.example.com";</script>
$CENTER_STYLE
Delete this line: $CREATEJS_LIBRARY_SCRIPTS
$ANIMATE_CC_SCRIPTS
$SCRIPT_START
var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;
function init() {
    canvas = document.getElementById("$CANVAS_ID");
    anim_container = document.getElementById("$ANIM_CONTAINER_ID");
    dom_overlay_container = document.getElementById("dom_overlay_container");
    $CREATE_LOADER
    $LOAD_MANIFEST
    $PRELOAD_ASSETS
}
$HANDLE_FILE_LOAD_START    
    $HANDLE_FILE_LOAD_BODY    
$HANDLE_FILE_LOAD_END
$HANDLE_COMPLETE_START
    //This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage.
    $CREATE_STAGE    
    //Registers the "tick" event listener.
    $START_ANIMATION        
    //Code to support hidpi screens and responsive scaling.
    $RESP_HIDPI    
$HANDLE_COMPLETE_END
$PLAYSOUND
$SCRIPT_END
<!-- write your code here -->
</head>
<body onload="init();" style="margin:0px;">
    
<a href="javascript:void(window.open(window.clickTag))">
    <div id="$ANIM_CONTAINER_ID" style="background-color:$BG; width:$WTpx; height:$HTpx">
        <canvas id="$CANVAS_ID" width="$WT" height="$HT" style="position: absolute; display: $CANVAS_DISP; background-color:$BG;"></canvas>
        <div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:$WTpx; height:$HTpx; position: absolute; left: 0px; top: 0px; display: $CANVAS_DISP;">
        </div>
    </div>
    $PRELOADER_DIV
    
</a>
</body>
</html>

 

4.  Load edited MyTemplate1.html

File > Publish Settings...  > HTML/JS  > Import New...  > Open > OK

  • Like 1
Link to comment
Share on other sites

On 8/18/2021 at 8:40 AM, schroedera234 said:

I am also looking for a solution for this

Sorry I hadn't much time last weeks to give a detailed answer, thanks @Web Dizajner for doing so

 

In the header section you can also call gsap and others libs, you can see all the google hosted libraries here: https://support.google.com/richmedia/answer/6307288?hl=en

 

I usually always call those 2:

<script src="https://s0.2mdn.net/ads/studio/cached_libs/easelplugin_3.5.1_min.js"></script>
<script src="https://s0.2mdn.net/ads/studio/cached_libs/gsap_3.5.1_min.js"></script>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...