Giter Club home page Giter Club logo

embed-api-demos's Introduction

Google Analytics Embed API Demos

This repo showcases many of the things that are possible with the Embed API. Each demo builds on ideas presented in the previous demo, so you should check them out in order. If you're curious how anything is done, browse around in the code to see for yourself.

View Demos โ†’

Demos Source Code

Custom Components Source Code

Running the Demos Yourself

To run the demos yourself, all you have to do is download the repo, navigate to the site folder, and start up a local server. Here's a really easy way:

# Clone the repo and cd into the site directory.
git clone [email protected]:googleanalytics/embed-api-demos.git
cd embed-api-demos/site/

# Start running a local server at http://localhost:4000
python -m SimpleHTTPServer 4000

Now just go to http://localhost:4000 in your browser and you should see the site.

Alternatively you can copy and paste the files manually or use FTP to transfer them to a remote server, though if you do that you'll have to change the client ID to one with your site's domain set as an approved origin.

Note: if you copy the files into a folder that is not at the root of your server, most of the links will not work and the page will probably look broken.

Building the site using Jekyll

If you're familiar with Jekyll it can make running the demos locally or deploying them to a remote server much easier. It's actually how this repo is built and how the demo app is deployed.

# Clone the repo and cd into the repo directory.
git clone [email protected]:googleanalytics/embed-api-demos.git
cd embed-api-demos

# Run the site locally using Jekyll
jekyll serve

The jekyll serve command will build all the files and load up a server on your local machine. Then you can go to http://localhost:4000 and everything should work fine. If you run jekyll serve -w it will also watch for changes to your source files and rebuild the site on the fly. This makes it easy to change a few things and see the results immediately.

If you need to change any of the configuration settings (like your client ID) you can set them in the _config.yml file and rerun the jekyll serve command.

embed-api-demos's People

Contributors

philipwalton avatar

Watchers

Ehsan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.