Web Designer Blog
The latest news and tips from the Google Web Designer team
Creating custom exits for dynamic remarketing creatives
Monday, April 3, 2017
Dynamic remarketing
is a great way to improve your advertising performance, especially if your goal is to sell more products. However, working with a dynamic creative can be tricky. Some of the values required by your creative, like call to action (CTA) text, Product Names, Exit URLs, etc., are not known ahead of time and come from a product "feed". Google Web Designer's Dynamic properties dialog can help you bind such values to elements in your creative, but what if you want to post-process these values before they are bound to your creative?
In this article, we will tackle one such case - adding a custom exit function to your dynamic remarketing creative, which lets you post-process the exit URL before exiting to it.
⚠
When working with a URL, take special care to generate a valid URL and keep in mind that some browsers have a maximum supported URL length.
Let's say you have created the six-product creative below for dynamic remarketing in DoubleClick Bid Manager.
Let’s begin by adding a custom exit for product 0:
Step 1: If applicable, remove the dynamic bindings for the "Exit Override URL" within the Tap Area component of product 0.
⚠
Without this change, clicking on your creative can lead to more than one exit.
Step 2: Select the tap area for product 0 (the first product).
Step 3: Add a new event for the tap area by clicking the "+" button on the Events panel.
Step 4: Select Tap Area > Touch/Click as the event.
Step 5: For the action, select Custom > Add custom action.
Step 6: Add a function name (e.g., mycustomexit0) then paste the below code snippet into the text area. Replace the comment with the logic for your custom post-processing, then click OK.
var exitURL = dynamicContent.Product_0_url
// Custom post-processing happens here
Enabler.dynamicExit("exit", exitURL, "0")
💡
Use Enabler.dynamicExit() instead of the traditional Enabler.exitOverride() for dynamic creative exits and pass in the product index as the third parameter. This helps Google's optimization engine understand which product was clicked on, and allows us to further improve performance of dynamic creatives.
Repeat the above steps for the other five products in the creative, changing the index accordingly, e.g., for the second product, use index 1, and so on.
To test your changes, follow the steps in the Bid Manager dynamic creative
help center article
to upload your creative in Bid Manager. Then, preview the creative and click on the products to verify your custom exits are working as expected.
Creating custom exits isn't so tricky after all! We've just shown you how your dynamic creative can use custom exits and send information about product-level clicks. If you require post-processing of exit URLs, try these steps with your creatives and let us know what you think in the comments below.
Posted by Manikandan, Software Engineer
Exploring text in Google Web Designer
Monday, March 13, 2017
In today’s blog post, we’ll show you how to manage the appearance of text throughout your Google Web Designer document. We’ll begin with simple changes, such as the font family, text weight, size or color. We’ll then show you how to make a new text element look like an existing one, and how to define default styles so you can reuse them easily.
Read more »
Google Web Designer training re-launched
Thursday, November 17, 2016
Google Web Designer training re-launches
: We’re thrilled to re-launch our core training for Google Web Designer, entitled “Get started with Google Web Designer”. This new Learning path and Achievement program has launched exclusively on Academy for Ads, Google’s hub for on-demand advertising training.
Take the training today
to learn the ins and outs of building HTML5 ads with the tool. Block off a couple hours to take the full learning path to develop the expertise you need to use Google Web Designer to the fullest.
Posted by Jasmine Rogers, on behalf of the Academy for Ads team
New usability features for Google Web Designer
Wednesday, November 16, 2016
We’re excited to introduce several new improvements to make Google Web Designer faster and easier to use. Whether you're copying and pasting across projects or dragging and dropping layers across the timeline, the tool allows you to work the way you need. Today, we're launching the following updates:
Timeline Enhancements:
Advanced Mode - Zoom:
Users can now zoom in and out of the timeline allowing for more precise placement of keyframes.
Multiple keyframe/thumbnail selection:
Easily select or delete all the keyframes (in Advanced mode) or thumbnails (in Quick Mode) in a layer at once.
Animate properties in the first thumbnail:
Quick Mode now allows editing the first keyframe and retaining the other keyframe properties.
Drag to hide/lock layers:
It is now possible to drag-select hide/lock icons in the layers instead of clicking each icon one by one. And users will still be able to click each layer to lock or hide, if desired.
New easing functions:
We have added two new easing functions for animation: step-start and step-end. Using these new functions for animated property values, users will gain more control over their animation transitions.
New easing functions for the animations in Google Web Designer
Copy/paste across documents
Any element that can be copied in the same document can now be copied to other documents, including assets and groups. In addition, if assets or other data conflicts, a dialog box will open to ask you to manually choose the resolution.
Preferences panel
Customize Google Web Designer to your style and workflow preferences in one central location. For example, you can set a number of Code View defaults including the color theme and preferred keymap.
JavaScript library support
DoubleClick Studio users can now easily import the Greensock JS Library for creatives made in Google Web Designer. You can also add a variety of plugins including TweenLite, TweenMax, and Text Plugins to help you build your creatives.
JavaScript library support in Google Web Designer
Today, we also launched a new Google Web Designer Learning path on
Academy for Ads
. This resource can help you learn the ins and outs of Google Web Designer in quick, five minute modules or dedicate more time to working through the full Learning path.
Ready to get started? Check out our Google Web Designer
ad gallery
for inspiration. If you’ve already downloaded Google Web Designer, it will automatically update to reflect the new features listed above. If you haven’t yet downloaded the tool, you can
download it for free here
.
Posted by Jasmine Rogers, Program Manager, Google Web Designer
Masking in Google Web Designer
Friday, November 4, 2016
Investigating Masking in Google Web Designer
Masking routinely tops the list of requested features in Google Web Designer. We investigated different approaches to implementing masking in HTML5, and we concluded that the limitations of existing browsers make effective masking infeasible at this time. We recognize that this is a disappointing result, so we’re using this space to explain (and show!) what we tried, and why we think masking is not yet ready for production.
What is masking?
A mask defines a region of the plane where content (the
maskee
) is rendered; outside of this region, the content is invisible. For example, a circular mask may be used to create a spotlight effect, by only revealing content within the "light". A complete masking solution would meet the following criteria:
Everything is maskable.
The maskee may include text, images, animation, SVG, canvases, videos, custom elements, and even other masks.
A mask can have any shape.
It may be as simple as a circle, or it may be multiple disconnected regions with complicated geometry.
Masks can be animated.
The mask can be translated, rotated, and scaled; it can be morphed into new shapes; and in the most general case, the mask can be a video.
Masks stack and overlap.
Placing one mask inside another is equivalent to intersecting the two masks. If two independent masks overlap, the output of one is rendered atop the other, with no other interference.
Events are masked.
Events originating outside the mask are blocked, and otherwise they pass through to the maskee without modification.
What did we try?
There is no way to achieve all of the above properties on any particular browser, much less every browser we support (i.e., Chrome, Firefox, Safari, and IE 10+). We don’t require perfection, however; an approximate solution can still be useful in practice. We initially experimented with
CSS3 masking
. Smooth mask animation is only possible if the mask is a CSS basic-shape, but otherwise all masking behaviors, such as those listed in the section above, are supported. However, CSS3 masking is not yet available on all major browsers.
Another way to implement masking, which is already supported by all major browsers, is to represent a mask as an element styled with
overflow: hidden
. This exhibits all masking behaviors, although the mask’s shape is equivalent to the element’s border, which effectively limits masks to rectangles, circles, ellipses, and capsules. Despite this limitation, overflow-based masking would still be useful for basic effects like wipes and reveals. Moreover, on browsers that support CSS3 masking, the mask’s shape could essentially be arbitrary, although animation would still be limited to the element’s transform. Unfortunately, we discovered that even in simple cases, overflow-based masking produced blurring and flickering artifacts on some browsers.
Finally, it’s worth noting that in simple cases, masking-like effects can be achieved simply by overlaying an image with transparent regions, which is already possible in Google Web Designer. This technique, however, is really the opposite of masking -- instead of rendering
only
within the mask region, it paints over everything that is
not
in the mask region.
CSS3 masking
We started by exploring CSS3 masking, which comes in two forms: clipping (clip-path) and masking (image-mask). Clipping crops the rendering of an element and its children to a binary mask defined either through an inlined SVG, or a “basic shape” consisting of a circle, and ellipse, or a polygon. Masking crops the element’s content to an image’s boundary, and then applies an alpha channel determined by the image content. As of this writing, browser support for CSS3 masking is as follows:
Clipping
is supported
on Chrome, Safari, and Firefox, although Firefox’s support for basic shapes is turned off by default.
Masking
is supported
in Chrome, Safari, and Firefox, but Firefox currently does not allow control over the image’s size or position.
IE does not currently support CSS3 masking, but future support
is likely
, at least for Edge.
We tested CSS3 clipping and masking in several different scenarios, and here’s what we found (
demo
):
Clipping.
Clip paths defined as SVG elements offer the most flexible representation of a mask’s shape, but CSS animations applied to SVG clipping elements are ignored at render time. Basic shapes offer less expressive mask geometry, but at least they can be animated: for circles and ellipses, the centers and radii are interpolated, and for polygons, control points locations are linearly interpolated (assuming that each keyframe has the same number of control points). One quirk is that in some browsers,
overflow: hidden
must be set on the mask element, or else the clipping path will be ignored if the maskee contains 3D transforms or has animated transforms (2D or 3D).
Masking.
Masking allows essentially arbitrary mask geometry, but animation of the mask shape is limited to defining CSS keyframes for mask-position and mask-size, allowing the mask to be translated and (non-uniformly) scaled. However, the mask is always rendered with positions and sizes rounded to the nearest integer, resulting in jagginess artifacts when the mask is animated slowly (
demo
).
In summary, smoothly animatable masks are only possible using clip-path with a basic shape — and even then, currently only in Chrome and Safari.
Overflow-based masking
An alternative to CSS3 masking is to set an element's overflow to “hidden”, and then add the maskee as a child element:
<div id=”mask”>
<div id=”maskee”></div>
</div>
This crops the maskee to the bounds of the parent element. Because the maskee is a child of the mask, however, moving the mask will also move the maskee. To allow them to move independently, we can insert an intermediate element that cancels changes to the mask.
<div id=”mask”>
<div id=”maskCancel”>
<div id=”maskee”></div>
</div>
</div>
For example, if mask is moved ten pixels to the left,
maskCancel
is moved ten pixels to the right, giving the appearance that maskee remains stationary while the mask reveals a different portion of it. More generally, changes to the mask configuration can be canceled as follows:
The intermediate element is forced to the same size as the mask, by setting its width and height to 100%.
If the mask’s left and top are (x, y), the intermediate element’s left and top are (-x, -y).
The intermediate element’s transform origin is identical to that of the mask, and its transform is the inverse of the mask’s transform.
Similarly, if the mask is animated using CSS3 keyframes, additional keyframes rules must be added to the intermediate layer to cancel this animation. Assuming that animation is limited to transform (per existing
best practices
), this means:
Animation of the mask’s transform-origin is copied to the intermediate element.
The inverse of the mask’s transform animation is applied to the intermediate element.
(2) is by far the most complicated part of the process, and as it need not be understood to evaluate the practical effectiveness of overflow-based masking, we discuss it in the Appendix at the end of this post.
We built a
proof-of-concept implementation
of overflow-based masking, and discovered that even in simple of cases, animating the mask transform produces blurring and flickering artifacts on some browsers. For example, here is a screenshot of Chrome’s output, using a circular mask that translates back and forth (
demo
):
It appears as if the maskee is first being rendered with the intermediate layer’s transform applied, and then re-rendered with the mask’s transform, resulting in blurring and flickering artifacts. This behavior is not consistent across browsers: as of this writing, the artifacts appear in Chrome in all cases, they appear in Firefox if the animation includes scale or rotation (
demo
), and they do not appear in IE or Safari. However, on all browsers, no artifacts are present if overflow is set to visible, but the mask/intermediate layer/maskee construct is otherwise left unmodified.
Animation of an element’s left, top, width, and height (LTWH) is generally discouraged, and by default GWD uses LTWH for static layout and translation/scale for animation. Still, in light of these rendering artifacts, it’s worth considering whether LTWH makes more sense for masking. One problem with LTWH animation is that it has
worse performance
than transform animation: dozens of objects can easily be animated at 60Hz using transforms, but will slow down to 10Hz or worse if LTWH is used. If a document only has one or two masks and isn’t too complicated, however, perhaps the performance penalty is acceptable. A second problem is that LTWH values are rounded to the nearest integer at render time, which avoids the rendering artifacts discussed above, but at the expense of creating clunky, stair-step-like animations when objects animate slowly (
demo
).
Stay tuned
We would love to add masking to Google Web Designer, but as an HTML5 authoring tool, we're limited by what browsers are able to support. Still, the web is constantly evolving, and browsers are continually improving, so we still hope and expect to ultimately be able to add masking to our suite of tools.
Posted by Lucas, Software Engineer
Appendix: Inverting animation for overflow-based masking
If a mask is rotated or translated, then an inverse animation can easily be created by reversing the order of each key’s transforms and negating the values of each transform channel. For example, if the mask’s transform is
translate(tx, ty) rotate(rz) scale(sx, sy),
then the intermediate element’s transform is
scale(1/sx, 1/sy) rotate(-rz) translate(-tx, -ty).
If a mask is also scaled, then the inverse scale animation is defined in terms of a reciprocal. For example, a simple linear scaling from s1 to s2 over a time interval T can be written as
and the inverse scaling animation is then
Functions like this cannot be exactly represented in CSS3, which
defines animation curves
as 2D cubic Bezier segments where the first dimension is time and the second dimension is normalized value. While we could simply disallow scaling, this would make it impossible to achieve wipe and reveal effects. Instead, we generate samples of the ideal inverse scale animation
and fit an approximating animation curve. For simplicity, in our experiments we constructed inverse animations as piecewise linear functions, although more compact results can be obtained by fitting general cubic Bezier curves. To determine an acceptable error tolerance for the approximation, consider an absolute error e resulting in a net scale at the maskee of
At a distance
d
from the transform origin, this yields a positional error of
sed
, and so given a maximum mask size of
M
, the maximum error
E
is
Positional discrepancies can therefore be kept below half a pixel by requiring
Intuitively, the smaller the scale value, the larger the error we can tolerate, because only a narrow slice of content will be visible through the mask. (It is also possible to invert animation of uniform scale by animating z translation, but this technique does not generalize to animations that include non-uniform scaling, and it alters the meaning of existing z translations authored in the maskee.)
Common animation topics from the Google Web Designer forum
Wednesday, June 8, 2016
Animation is a key element in most creatives made in Google Web Designer and our community forum is filled with interesting and complex topics on the subject. In this blog post, we will go over some common animation scenarios that are brought up in our forum, and provide workarounds to avoid these issues in creatives.
Animation goes behind other elements unexpectedly
Users have reported that some elements go behind other elements in animation on a browser preview. Let’s walk through the issue and try some potential solutions to the problem. Download
my_test.zip
to to see the actual example file.
To begin, we see a background gray image in a layer, and another image that shows 10 with a white background sitting on the top. 3D rotation animation is applied to the “10” image.
When you preview on a browser, the animation appears as this.
Approach 1 - Adjusting Z translation value for the background.
First, we want to make sure the rotating image is always above the background image. In order to do so, let’s move the gray background further behind by giving it a negative Z translation value in Properties Panel. When you change the Z value for the gray image, it appears smaller than the original image dimensions. To offset this, you can adjust the size of the image by using the Transform tool.
The “10” image should now be rotating in 3D on top of the gray background.
Please preview to ensure that the new adjustment of the 3D z value works on all browsers.
Approach 2 - Adjusting Z translation value for the element animated in 3D.
You can also adjust z translation value for the animated element to make it stay on top of other elements. If approach 1 doesn’t fix the issue, or the background image can not be altered for some reason, please try this approach.
In this example, select each keyframe for the image “10”, then add 110px of Z translation for all the keyframes. This will make the image appear larger than the original dimensions. To fix that, try adjusting the 3D scaling for each keyframe to a value that’s less than one, like 0.93. You may have to test different values to find out what works best for your animation.
Animation overlaps
We have heard occasionally that the elements on animation overlap each other when previewed on Safari even though they are laid out correctly in timeline and previewed correctly on the stage, or browser. This can happen when animation delays and ‘Pause’ events are used in the timeline.
To explore, let’s create an animation that shows “Yea” in a text box first, then pauses it. When a page background, a white background is clicked, the timeline starts playing to show ”Nay” text as “Yea” goes away. Download
test-overlap.zip
to see to see the actual example file.
When it is previewed on Chrome browser, it shows as this:
If you preview this on Safari, when the animation is paused, Nay is already displayed and overlapping with Yea before any user interaction happens.
Let’s try to resolve this overlap.
Approach - Removing the animation delays
When the overlap happens, let’s remove the animation delays for all the animated layers. In order to do so, 1) Move the playhead all the way back to 0.1s., 2) Select all the layers that have animation delays, 3) Hit F6 function key to add keyframes, 4) Move the keyframes to 0 until they appear as half diamond shapes.
This should fix the overlapping preview issue on Safari. After adjusting the animations, please test on all the browsers to verify adjustment works on all.
Page animation control
Many users have asked how to play the animation through pages, then make it go back to the first page and pause the animation at a certain point. It would also be great if we could control how long the animation plays and then pauses.
Let’s say you wanted to set up three pages in your creative and play the animation in the following page order. You want each page to play the animation for 2sec, then go to the next page until all the pages are cycled through twice.
Page 1
Page 2
Page 3
Page 1
Page 2
Page 3
Page 1 (end)
Approach - setTimeout event as a custom action
We can achieve this by adding a ‘setTimeout’ event for the timeline. Let’s walk through this process by using this example file
pages.zip
. Please download it and open pages.html file.
The example file is a three page ad file that has timeline animation on each page. Once you’ve downloaded it, preview it in your browser to see how it works. Now let’s look at the details.
On page1 we’ve added an event marker at 2 second mark to go to next page, page1_1. We’ve also added a timeline label “end” where we would like to end the whole animation after it’s gone through the page changes two times.
If you look at the events panel, the event that changes the page is shown as page1>event-1>GotoPage>pagedeck(page1_1)
Let’s take a look at the second page (page1_1) which is similar. Again, there is animation in the timeline and a timeline event marker added at the 2 second mark. If you look at the events panel, this event is displayed as page1_1>event-2>GotoPage>pagedeck(page1_2). When the animation plays on this page, it simply executes the timeline event at 2 seconds and goes to the next page.
Finally, let’s open the last page (page1_2). This is where we’ve added a custom action to control how long the animation plays until the ‘gotoAndPause’ event gets fired.
If we look at the timeline on page3, we see an event marker at the 2 second mark, just like the other pages. In the Events panel, you can see that there are two events associated with event three. The first has a custom action.
Note: 6000ms = 6s
We’ve added “setTimeout” as a function name, and created the following code:
setTimeout(nextPage, 6000);
function nextPage() {
gwd.actions.timeline.gotoAndPause('page1', 'end');
}
When this event gets fired, it will trigger a 6 second timeout, and then the page will go to ‘end’ label on ‘page1’ and pause the animation there. This six seconds represents the time it will take for the animation to cycle through another time. If we wanted the animation to cycle through the 3 pages three times, we’d have to set the timer to 12 seconds.
If you look at the events panel, you can see that there’s a second event attatched to event-3: page1_2>event-3>GotoPage>pagedeck(page1). This simply makes the page go back to the first page. It is important to remember that ‘setTimeout’ event has to be added before ‘GotoPage’ event, because ‘setTimeout’ should be executed before the page goes to the next page.
Now we can see how it works. Each page plays the animation for 2 sec and goes to the next page.On page 3 (page1_2), ‘setTimeout’ event gets fired, and the animation then continues to play normally for 6 seconds, when it then goes to the label “end” on page1 and pauses the animation there. As a result, all the pages are cycled through twice and the animation ends at the label “end”.
Using custom actions like this example will give you more control over your creative and its interactive content. Custom actions are saved in your file and you can reuse them for other elements if you like.
Final Thoughts
As developers we understand that it can be frustrating to deal with small differences and rendering issues on different browsers, platforms and devices. The Google Web designer team is working hard to solve those from the authoring side as we continue to release new feature enhancements. Please be sure to download the zip files and try the techniques in this article. We would also like to hear from you, so please send us your feedback and issue reports in our community forum!
Posted by Mariko, Test Engineer
A revamped UI and responsive design capabilities, now in Google Web Designer
Tuesday, May 3, 2016
Today, we're releasing a new version of Google Web Designer that includes an entirely revamped UI and responsive design capabilities to help you create true responsive ads!
Check out our
Announcement
and the resources below for more information!
Resources:
Release Notes
Blog
Help Center Articles:
Responsive
,
UI
Videos:
Responsive
,
UI Overview
Posted by Jasmine Rogers, Google Web Designer
Labels
animation
animations
BYOC
carousel
clips
css
CTA
custom code
Display
DoubleClick Bid Manager
DoubleClick Studio
dynamic
engagement ads
events
exit
fluid layout
gallery
google cultural institute
google web designer
groups
HTML5
javascript
lightbox
looping
masking
new release
new version
pages
publish
responsive
sales animation
swatches
swipeable
text
UI
Archive
2017
April
Creating custom exits for dynamic remarketing crea...
March
2016
November
June
May
April
March
February
Feed
Follow @googlewdesigner