If you're running Google ads campaigns and driving those leads to Maven HQ, you need to ensure that you have attribution tracking setup. This is important so you know where you leads are coming from - down to the campaign and search term level in Maven HQ.


Here's a video walkthrough:




To identify traffic from Google Ads and for Mavenhq.io to categorize it as "Paid Search", ONE of the two rules need to be satisfied:

  • • "gclid" is one of the parameters
  • • utm_source=adword 


Any other information that needs to be tracked can be sent in one or more of the parameters such as utm_medium, utm_campaign, utm_content, campaign_id, utm_keyword, etc.


UTM Script to copy on Account or Campaign level:

{lpurl}?utm_source=adwords&utm_medium={_adgroup}&utm_campaign={_campaign}&campaign_id={campaignid}&utm_content={creative}&utm_keyword={keyword}

Adwords script to paste in Google Ads account:

function  main()
{
var TrackingTemplate="{lpurl}?utm_source=google&utm_medium=cpc&utm_campaign={CampaignName}~{AdGroupName}";  
  
var _CAMPAIGN_CONTAINS="";               //Filter by Campaign name   
var _ADGROUP_CONTAINS="";               //Filter by Adgroup name 
var STATUS="ENABLED";                    //ENABLED, PAUSED
if(TrackingTemplate.search(/{AdGroupName}|{CampaignName}/g)==-1){Logger.log("Enter at least one of the {CampaignName} or {AdGroupName} parameter in the tracking template");return}   
if(TrackingTemplate.search("{CampaignName}")>0&&TrackingTemplate.search("{AdGroupName}")==-1)
{
var campaignIterator=_CAMPAIGN_CONTAINS==""?AdsApp.campaigns().withCondition("Status = "+STATUS).get():AdsApp.campaigns().withCondition("Name contains '"+_CAMPAIGN_CONTAINS+"'").withCondition("Status = "+STATUS).get();
if(!campaignIterator.hasNext()){Logger.log("No Campaigns matched with this condition");return}
while(campaignIterator.hasNext())
  {  
  var campaign=campaignIterator.next(); 
  var campaigntemplate=TrackingTemplate.replace(/{CampaignName}/g,campaign.getName().replace(/\s/g,'%20'))
  campaign.urls().setTrackingTemplate(campaigntemplate);
  Logger.log(campaign.getName()+" => "+campaigntemplate)  
  }
  
}  
if(TrackingTemplate.search("{AdGroupName}")>0)
{
var adgroupIterator = {hasNext:function(){return false}}  
if(_ADGROUP_CONTAINS==""&&_CAMPAIGN_CONTAINS=="")
{adgroupIterator=AdsApp.adGroups().withCondition("Status = "+STATUS).get();}
else if(_ADGROUP_CONTAINS==""&&_CAMPAIGN_CONTAINS!=="")
{adgroupIterator=AdsApp.adGroups().withCondition("CampaignName contains '"+_CAMPAIGN_CONTAINS+"'").withCondition("Status = "+STATUS).get();}
else if(_ADGROUP_CONTAINS!==""&&_CAMPAIGN_CONTAINS!=="")
{adgroupIterator=AdsApp.adGroups().withCondition("CampaignName contains '"+_CAMPAIGN_CONTAINS+"'").withCondition("Name contains '"+_ADGROUP_CONTAINS+"'").withCondition("Status = "+STATUS).get();}
else if(_ADGROUP_CONTAINS!==""&&_CAMPAIGN_CONTAINS=="")
{adgroupIterator=AdsApp.adGroups().withCondition("Name contains '"+_ADGROUP_CONTAINS+"'").withCondition("Status = "+STATUS).get();}
if(!adgroupIterator.hasNext()){Logger.log("No Campaigns/Adgroups matched with this condition");return}
while(adgroupIterator.hasNext())
{   
  var adgroup=adgroupIterator.next();
  var adgrouptemplate=TrackingTemplate.replace(/{AdGroupName}/g,adgroup.getName().replace(/\s/g,'%20'))
  if(TrackingTemplate.search("{CampaignName}")>0) {adgrouptemplate=adgrouptemplate.replace(/{CampaignName}/g,adgroup.getCampaign().getName().replace(/\s/g,'%20'))}
  adgroup.urls().setTrackingTemplate(adgrouptemplate);
  Logger.log(adgroup.getCampaign().getName()+" => "+adgroup.getName()+" => "+adgrouptemplate)
} 
}    
}