AdWords
4.4K members online now
4.4K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

obtain parameters through gclid

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭
What I'm trying to develop is to create a script for google adwords, which will have to function :
 
1- Collect user data by completing the contact form on the landing page you are visiting .
 
2- Provide us that landing visiting the user whether or not to fill out the form , the ad group , the campaign to which it belongs and keyword entered by the user (if you can) but serious keyword why it has triggered the ad and whether or not there has been conversion .
 
3- this pass it to a google sheet .
 
 
Not if I have now explained well , but let me know . So far I have this code: which includes the gclid me the landing page, ad group , campaign, date and keyword why is activated. but I need to point 1 , it is to collect user data if you complete the contact form and whether or not there have been conversions .
This is my CODE:
var GOOGLE_DOC_URL = "https://docs.google.com/spreadsheets/d/1wlTyFTlMfhBBHfo3RtN9IWW6_8NqL9bDFYU71ZdVCyA/edit#gid=0"; 

function main() {
        
  clicks = runCampaignReport();
  modifySpreadSheet(clicks);
  
}
function runCampaignReport() {

    var listOfClicks = [];
  
        var report = AdWordsApp.report(
     'SELECT Date, GclId, ClickType, Page, Slot, AdFormat, CityCriteriaId, RegionCriteriaId, CountryCriteriaId, CriteriaParameters ' +
     'FROM   CLICK_PERFORMANCE_REPORT ' +
      'DURING YESTERDAY');
    
     var rows = report.rows();

         while (rows.hasNext()) {
                   var row = rows.next();
       
           var date = row['Date'];   
                   var gclid = row['GclId'];
           var clickType = row['ClickType'];
                   var page = row['Page'];
                   var slot = row['Slot'];
                   var criteria = row['CriteriaParameters'];
                   var adFormat = row['AdFormat'];
                   var city = row['CityCriteriaId'];
           var state = row['RegionCriteriaId'];
           var country = row['CountryCriteriaId'];
                   var userList = row['UserListId']
                   
           var clickResult = new clickData(date, gclid, clickType, page, slot, criteria, adFormat, city, state, country, userList);
       
           listOfClicks.push(clickResult);
           
         }  // end of report run
    
         return listOfClicks;
     
} 

function clickData(date, gclid, clickType, page, slot, criteria, adFormat, city, state, country, userList) {
        this.date = date;
        this.gclid = gclid;
 this.clickType = clickType; 
        this.page = page;
        this.slot = slot;
        this.criteria = criteria;
        this.adFormat = adFormat;
        this.city = city;
    this.state = state;
    this.country = country;
        this.userList = userList;
        
} 

function modifySpreadSheet(results) {
  
  var gclidResults = results;
  
  var gclidSS = SpreadsheetApp.openByUrl(GOOGLE_DOC_URL);
  
  var sheet = gclidSS.getActiveSheet();
  
  var columnNames = ["Date", "Gclid", "Criteria", "ClickType", "Page", "Slot", "AdFormat","City", "State", "Country","UserList"];
  
  var headersRange = sheet.getRange(1, 1, 1, columnNames.length);
          
   for (i = 0; i < gclidResults.length; i++) {
        headersRange.setValues([columnNames]);
                     var date = gclidResults[i].date;
                     var gclid = gclidResults[i].gclid;
                     var criteria = " " + gclidResults[i].criteria;
                     var clickType = gclidResults[i].clickType;
                     var page  = gclidResults[i].page;
                     var slot = gclidResults[i].slot;
                     var adFormat = gclidResults[i].adFormat;
                     var city = gclidResults[i].city;
                     var state = gclidResults[i].state;
                     var country = gclidResults[i].country;
            
      sheet.appendRow([date, gclid, criteria, clickType, page, slot, adFormat, city, state, country]);
    }  
}
2 Expert replyverified_user

Re: obtain parameters through gclid

Top Contributor
# 2
Top Contributor

Hi @Aitor U you won't be able to tie a gclid to user data via Scripts.

 

Why are you trying to do this?  The data you want (which Keyword, which Ad Group, caused a form completion) is available using the normal AdWords tools (conversion tracking).


Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits

Re: obtain parameters through gclid

Rising Star
# 3
Rising Star
To my knowledge GLID data is encrypted and complicated to break down. I've seen some articles that do it but you need the algorithms.

In general what you can do is create an event/goal in Universal Analytics and with every time that the event fires you'll have information on their date/city/country/keyword match/etc. although you won't be able to tie the data to an email unless you take advantage of Universal Analytics User ID feature although that may be tricky ...
Joshua, Rising Star
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

Re: obtain parameters through gclid

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi thank you both for answers , not if I explain evil but because I want to do this is to get more control over conversions.
I read that through a script that gives you google for offline conversions can know the gclid the customer who has entered that announced , and through that I think we can send the form data + the gclid a google sheet where ayi we compare the gclid to a report where we show the gclid , date, campaign, ad group , keyword , country , city and buy the gclid customer with that sheet

Re: obtain parameters through gclid

Top Contributor Alumni
# 5
Top Contributor Alumni
Hi
Logically what you are trying to do makes sense but
GCLID is not available as dimension in AdWords which you are trying to query.
For offline conversions GCLID is uploaded in AdWords for conversion and is mapped in the background in DB and only matching conversion metrics are shown.
I hope this makes sense
Regards, Nik
LinkedIn  |   @nikhilparachure | My Blog

Re: obtain parameters through gclid

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Hello again, perdonde not respond thank you all for responding.

A question like I make a report conversions in the last 7 days and send them to a sheet .

With the conversion report I can know the country , date , keyword and url I visit the customer who made the conversion?

Re: obtain parameters through gclid

Top Contributor Alumni
# 7
Top Contributor Alumni
HI
You are uploading offline conversions and you want to know country, click date , keyword and Landing page for these conversions, is that correct assumption?

Regards, Nik
LinkedIn  |   @nikhilparachure | My Blog

Re: obtain parameters through gclid

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭

No , I mean do it via script