Скрипт для генерации списков ремаркетинга в Google AdWords через GA

Статья

Инструкция:

  1. Включаем расширенное АПИ: https://developers.google.com/adwords/scripts/docs/features/advanced-apis?hl=ru
  2. Готовим нужный спридшит https://goo.gl/4ZAb7Z
  3. Редактируем скрипт и добавляем:
    function main() {
    
      var settings = {'linkedView':"XXXXXXXX",
                      'linkedAccountId':"XXX-XXX-XXXX",
                      'accountId':'XXXXXXX',
                      'propertyID':'UA-XXXXXXX-X'};
    
      var spreadsheet = SpreadsheetApp.openByUrl('https://goo.gl/4ZAb7Z');
      var sheet = spreadsheet.getSheetByName('Sheet1');
      var range = sheet.getRange(1, 2, sheet.getLastRow(), 3);
      var values = range.getValues();
      Logger.log(values.length);
    
      for(var i = 0; i < values.length; i++) {
        var name = values[i][0];
        var categoryUrl = values[i][1];
        var duration = values[i][2];
        var newAudience = Analytics.Management.RemarketingAudience.insert(
          {
            'name': name,
            'linkedViews': [settings.linkedView],
            'linkedAdAccounts': [{
                'type': 'ADWORDS_LINKS',
                'linkedAccountId': settings.linkedAccountId,
            }],
            'audienceType': 'SIMPLE',
            'audienceDefinition': {
              'includeConditions': {
                'daysToLookBack': 7,
                'segment': 'sessions::condition::ga:PagePath=@' + categoryUrl,
                'membershipDurationDays': duration,
                'isSmartList': false
              }
            }
          },
        settings.accountId,
        settings.propertyID);
    
       Logger.log(i + ' Аудитория ' + name + ' создана');
      };

План обучения Data science

SQL: If you can’t get data, you can’t analyze data. Whether you retrieve data from a SQL database or Hadoop cluster with a SQL-language layer on top of it, this is where you start. http://sqlschool.modeanalytics.com/ is a great interactive learning interface. O’Reilley’s SQL Cookbook is a masterpiece that traverses all levels of SQL proficiency.
Full-Stack Data Science: Coursera offers a full stack online curriculum on a continuous basis for a reasonable price. This DOES NOT teach you SQL. If you’re in SF or NYC, you can attend General Assembly’s pricier in-person full stack curriculum. This gives you a cursory introduction to data storage, retrieval, prep, light analysis, and deeper predictive and inferential analysis.
Python: Code Academy or Udemy will teach you the basics. Python can play two functions in the skill stack: 1) to conduct ad-hoc statistical analysis as you would with R, 2) to do everything else. Python is important for the «everything else.» You might use it to get data from APIs, scrape, write ETL jobs, refresh data in your warehouse, or retrain models. This is the piece of the skill stack moves you from being a Static Data Scientist (one who works with data in a manual fashion), to a Live DataScientist (one who has automated many of the processes contributing to data science output, loosely defined).

Basic Statistics: Khan Academy Probability and Statistics.
Linear Algebra and Multivariable Calculus: Go to a local college or Khan Academy to brush up on Multivariable Calculus and Linear Algebra. Their curriculums have largely been the same for the past 5 decades.
Mapreduce/Hadoop: Focus on this last**. There are so many technologies that enable SQL-like interfacing with Hadoop that to know how to write a MapReduce job is, for the most part, not necessary. To build real MapReduce pipelines is a behemoth of a task that might be the work of an early-stage startup Data Scientist, but shouldn’t be if you have a solid BI infrastructure team. This is why companies hire the rockstars we know as backend and data engineers. Side note: if you ever meet one and aren’t sure what their company does, thank them for their service to our country, regardless.
Cleaning: plan to spend most of your time cleaning and transforming in these languages/technologies. The analysis is the fast and fun part.