Welcome to WebmasterWorld Guest from

Forum Moderators: buckworks & eWhisper & skibum

Message Too Old, No Replies

Implementation of Adwords Remarketing JS Code

Want to merge campaigns into one snippet of code

5:12 am on Apr 21, 2011 (gmt 0)

New User

10+ Year Member

joined:Nov 1, 2005
posts: 27
votes: 0

I'm setting up Adwords Remarketing - where users that click ads for a particular product but don't buy are served MORE ads later as they travel around the web.

We sell a variety of products, and have separate campaigns for each. I'd like to show ads pertaining to specific campaigns to those users. I'd have to do a different code snippet for each campaign.

Users searching for Widgets should see widget ads. Users searching for other products should see those relevant ads.

Is there a way that I can munge the code together for several campaigns and place that chunk of code site wide? I've tried to do some kind of JS if/then = document.write tricks, but nothing seems to be working correctly.
2:32 pm on Apr 21, 2011 (gmt 0)

Moderator This Forum

WebmasterWorld Administrator buckworks is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 9, 2001
votes: 101

Trying to serve the code sitewide would wreck the targeting if you want to show widget ads to widget seekers, different product ads for different product seekers, etc.

Users that are to be shown your widget ads get cookied for that when they visit your widget pages, not some other page. Ditto for the other products. If you just use the same code sitewide, AdWords wouldn't know how to target which loses the whole point.

Side comment, but related: Remarketing with followup ads is most effective (and most cost-effective) if you keep a light hand about it. Set tight daily frequency limits to make sure you don't overdo it. User respond best when the effect you achieve is an occasional courteous reminder, not "stalk the user".
2:44 pm on Apr 21, 2011 (gmt 0)

New User

10+ Year Member

joined:Nov 1, 2005
posts: 27
votes: 0

Thanks for the reply Buckworks - I understand how users are coming in from specific ad campaigns, and that the intent is to show them relevant product ads as they go other places.

It's not possible to do product-specific snippets of code - my product URLs are similar to



I was trying to work up some kind of a JS function that might do this:

if URL contains ('widget')
document.write('google widget code)
if URL contains ('other')
document.write('google other code')

But I can't seem to get document.write to actually write the google js code that google provides.