It turns out, there are two magic numbers that you need in order to get this to work. When you login to your account, in the url, you will see __u=
After that, you can include the function in all your scripts and deep link to your heart's content. It isn't the prettiest thing in the world but it is self contained so it should be easy to copy into the bottom of your scripts.
Thanks,
Russ
// Link to the Keyword Tab of the AdGroup Logger.log(getUrl(someAdGroupEntity,'Keywords')); // Link to the Ads Tab of the AdGroup Logger.log(getUrl(someAdGroupEntity,'Ads')); // Link to Location Settings Tab of the Campaign Logger.log(getUrl(comeCampaignEntity,'Settings:Locations'));
/*********************************** * Build Deep Link Urls for Entities * Version 1.0 * Created By: Russ Savage * FreeAdWordsScripts.com ***********************************/ function getUrl(entity,tab) { var customerId = '__c from the url'; var effectiveUserId = '__u from the url'; var decodedTab = getTab(tab); var base = 'https://adwords.google.com/cm/CampaignMgmt?'; var url = base+'__c='+customerId+'&__u='+effectiveUserId+'#'; if(typeof entity['getBudget'] !== 'undefined') { //A Campaign return url+'c.'+entity.getId()+'.'+decodedTab+'&app=cm'; } if(typeof entity['createKeyword'] !== 'undefined') { //An AdGroup return url+'a.'+entity.getId()+'_'+entity.getCampaign().getId()+'.'+decodedTab+'&app=cm'; } if(typeof entity['getMatchType'] !== 'undefined') { //A Keyword return url+'a.'+entity.getAdGroup().getId()+'_'+entity.getCampaign().getId()+'.key&app=cm'; } if(typeof entity['getHeadline'] !== 'undefined') { //An Ad return url+'a.'+entity.getAdGroup().getId()+'_'+entity.getCampaign().getId()+'.create&app=cm'; } return url+'r.ONLINE.di&app=cm'; function getTab(tab) { var mapping = { 'Ad groups':'ag','Settings:All settings':'st_sum', 'Settings:Locations':'st_loc','Settings:Ad schedule':'st_as', 'Settings:Devices':'st_p','Ads':'create', 'Keywords':'key','Audiences':'au','Ad extensions':'ae', 'Auto targets':'at','Dimensions' : 'di' }; if(mapping[tab]) { return mapping[tab]; } return 'key'; //default to keyword tab } }
You should consider this while you gonna adopt this code to the modern realities.
ReplyDeleteI have read so many content regarding the blogger lovers except this post is in fact a nice article,
ReplyDeletekeep it up.
VCUT Pro
Good blog. Keep sharing. I love them Are you also searching for Spanish writing help? we are the best solution for you. We are best known for delivering Spanish writing services to students without having to break the bank
ReplyDelete0km Business is the large trading platform for wholesalers, resellers, closeout dealers and importers. The wholesale marketplace is a must for traders who want to make new business contacts or are looking for new suppliers and buyers.
ReplyDeleteOffer remaining items, special items, new goods, trend items, bankruptcy goods, imported goods and surplus assets.
0kmbusiness