Skip to content

Instantly share code, notes, and snippets.

@ben-caplan
Created April 25, 2014 17:31
Show Gist options
  • Save ben-caplan/11297130 to your computer and use it in GitHub Desktop.
Save ben-caplan/11297130 to your computer and use it in GitHub Desktop.
#set( $currentPageURL = "http://$request.getServerName()${request.getAttribute('javax.servlet.forward.request_uri')}" )##
#set( $adWords = $dotcontent.pull("+structureName:AdwordsConversionCodes +AdwordsConversionCodes.targetPageUrl:${currentPageURL} +languageId:${currentLang}", 1, '') )##
#if( $adWords.size() < 1 )##
#set( $currentPageURL = $currentPageURL.replaceAll("((http)s?://)|(www\.)", '') )##
#set( $adWords = $dotcontent.pull("+structureName:AdwordsConversionCodes +AdwordsConversionCodes.targetPageUrl:${currentPageURL} +languageId:${currentLang}", 1, '') )##
#end##
#if( $adWords.size() > 0 )##
#set( $adWords = $adWords.get(0) )##
<input type="hidden" name="ga_ppc_conversion_id" id="ga_ppc_conversion_id" value="${adWords.conversionId}" />
<input type="hidden" name="ga_ppc_conversion_label" id="ga_ppc_conversion_label" value="${adWords.conversionLabel}" />
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment