In today’s webinar, I discussed some of the advantages of bringing data from Google Analytics into FileMaker Pro. I also illustrated how simple it can be to accomplish. In order to make this task even easier for you, I want to provide you with some helpful links, and even some sample files to get you started.
- Getting Started –> This explains the basics like what you need in order to begin using the Google Analytics Data Export API
- PHP GAPI –> This is where you can download the PHP file that contains the class object that you can use in your own database
- Feed Reference –>Discusses the structure of feeds from the Google Analytics Data Export API
- Common Queries –>How to compose queries that are commonly made
- Query Explorer –>Build a query using a simple to use form (includes combo boxes etc…)
- Dimensions & Metrics –>These are two parameters that are mandatory when querying Google’s Data Export API. This page will teach you which values can be used, and what kinds of results can be expected when you use them.
- Valid Query Combinations –>This document will explain which combinations of dimensions and metrics are possible
This is a .zip file containing sample PHP and batch scripts that can be used to help you get Google Analytics data into your FileMaker database. These files are intended for use in PHP-CLI, and should not be placed in a web-accessible directory (unlike most .PHP files)
Download Sample Code
What you need to do to get this to work:
- Your server must have PHP installed (should be PHP 5+)
- Extract the .zip file provided above to FileMaker Server’s “Scripts” folder (that folder is necessary if you’re going to be using this to auto-update your solution).
- Modify the “Report.php” file so that the “require_once” lines point to the appropriate paths of both your FileMaker.php(provided with FileMaker Server) and your “gapi.class.php”(link provided above)
- Insert your Google Analytics email address and password into the appropriate spots within “Report.php”
- Specify the filename, path to server, username, and password to your FileMaker Server hosted database within “Report.php” (account must have fmphp privilege)
- runReport.bat might need to be modified to contain the full path to your php.exe file (if that path is not defined within your environment variables)
- parameters should be modified within runReport.bat
- Have the file runReport.bat dynamically generated in order to get the most out of this
- When executing your PHP script (within runReport.bat), you’ll need to provide four parameters (websiteProfileID, startDate, endDate, reportType)
- Additional report types can be added simply by creating new PHP files within the “Reports” subfolder (use other files within that folder as a template for creating new ones)
Also… if you have any questions about what was discussed in my webinar today, please feel free to leave your questions here, and I’ll try to answer them as best as I can.
Edit: FileMaker Inc. has now posted my webinar so you can view it online
Edit: apparently the link posted above is no longer valid. If you would still like to see the webinar, then you can find a downloadable copy of it here.
Please note that you might need the appropriate player and/or codecs installed in order to view it.