Automation is a holy grail in marketing. But with so many automation methods available, it can be difficult for marketers to identify where to start.
Presentation of the Google Apps script editor
To create a Google Apps script, you need to access the Google Application Script Editor, an integrated development environment (IDE). IDEs act like a sandbox, a dedicated environment for easily making corrections and exploring functions. Online programming editors like CodePen have made this arrangement popular.
First, sign in to your Google Account. This will allow you to make sure that the Script Editor recognizes the account. Open your browser in the Script Editor (at script.google.com), then click “Show Dashboard”. At the top left of the screen, click on the “New project” button. Once you do, it will take you to the editor. You can rename the project and save it here on the editor screen.
The Google Apps Script Editor provides commands to facilitate script development. There are three user interface menus, as well as the main editor itself. A menu on the left side of the screen is a column menu for accessing IDE functionality. You can preview your saved project script, triggers for setting up alerts and extensions, which are connections to other services.
Related article: Balancing Automation and Intelligence in Your Martech Stack
Getting Started with Application Scripts and Script File Types
The main editor will fill most of the screen. This is where you will create the script. The editor provides a generic function script by default, but you can delete this code and paste it into the code template you want to use.
Above the editor is a menu with buttons to test your model. You can run it and debug it. There is a button to deploy your script, either starting from scratch or matching it with a previously deployed script. You can also test specific functions and identify errors through an execution log that appears at the bottom of the screen.
The publisher can also create stand-alone scripts, scripts that are not exclusively used with a Google platform. Marketers can deploy these scripts as a web application, which will be useful if your script is connected to another platform.
When you want to include data from other applications, you use services. Services are API connections to other Google platforms. This is where you can select the Analytics API, but there are others like Big Query, Google Calendar, Google Docs, and Google AdSense. The API for these services must be enabled before use in a Google application script. Metrics in Google Analytics are covered as a variable. For example, you can use the visitors metric from Google Analytics in a variable using the GA: visits parameter.
There are also libraries. Libraries are extensions very similar to packages used in R programming. Libraries collect existing Google Apps scripts in one place for reuse in developing new scripts. Marketers can search libraries and locate specific assets by Script ID.
How to best work with Google Apps scripts
Google Apps scripts can connect to over 30 built-in services to interact with user data, other Google systems, and external systems. To innovate with your automation goals, it’s a good idea to go through the documentation associated with an API so that you can understand what parameters are being extracted. You should also consult the Apps Script developer guides for ideas on what you might want to report in your Google script.
A good time to add Google Apps scripts is when reviewing the automation code that supports your campaigns. Decide whether or not the code is sufficient for your needs. Are the APIs used secure? Are the data delivered by the APIs validated? Asking such questions ensures that ingested data does not bypass any data compliance issues or create unnecessary technical debt.
Pierre DeBois is the founder of Zimana, a digital analysis consulting firm for small businesses. It examines data from web analytics and social media dashboard solutions, then provides web development recommendations and actions that improve business marketing strategy and profitability.