HTML5 - Design Program Troubleshooting - Google Web Designer (GWD)


Setup Instructions:

Use these steps before you publish or export your HTML5 assets from Google Web Designer:


function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" :
decodeURIComponent(results[1].replace(/\+/g, " "));
}
window.open(getParameterByName("clickTAG"));

Creative isn’t clicking through


<script type="text/javascript" gwd-events="handlers">
gwd.clickTAG = function(event) {
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" :
decodeURIComponent(results[1].replace(/\+/g, " "));
}
window.open(getParameterByName("clickTAG"));
};
</script>

Creative isn’t tracking clicks

Similar to the previous example—simply add the following script just above the closing </head> .

<script type="text/javascript" gwd-events="handlers">
gwd.clickTAG = function(event) {
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" :
decodeURIComponent(results[1].replace(/\+/g, " "));
}
}
</script>


Click through URL is hard-coded

We need to find all instances of the click-through url and replace with the "clickTAG" value: