{"id":19935109,"url":"https://github.com/optimizely/snippet-config","last_synced_at":"2025-05-03T12:31:00.332Z","repository":{"id":71780608,"uuid":"154091426","full_name":"optimizely/snippet-config","owner":"optimizely","description":"An illustration of the use of Optimizely X Full Stack to configure the Optimizely X Web snippet on a simple web page.","archived":true,"fork":false,"pushed_at":"2018-10-23T22:50:04.000Z","size":798,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":91,"default_branch":"master","last_synced_at":"2025-03-01T12:17:16.723Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/optimizely.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-22T05:27:12.000Z","updated_at":"2023-09-22T16:06:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"3289e2d1-42b1-414c-a4c2-4fcdab35dc73","html_url":"https://github.com/optimizely/snippet-config","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Fsnippet-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Fsnippet-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Fsnippet-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Fsnippet-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/optimizely","download_url":"https://codeload.github.com/optimizely/snippet-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252190672,"owners_count":21708924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T23:18:48.054Z","updated_at":"2025-05-03T12:31:00.325Z","avatar_url":"https://github.com/optimizely.png","language":"HTML","readme":"# Snippet configuration example app\n\nThis application illustrates the use of Optimizely X Full Stack to configure the Optimizely X Web snippet on a simple web page.\n\n## Repository structure\n\nHere's a description of the important files in this repository:\n\n        /application.py  # python webapp which uses Full Stack to render\n                         # the Optimizely Web snippet in the HTML response\n\n        /optimizely_config_manager.py     # A simple container class for the\n                                          # Optimizely instance used by application.py\n\n        /datafile.json    # A local copy of the Full Stack project datafile\n                          # application.py is configured to read from this file\n                          # rather than directly from cdn.optimizely.com\n\n        /update_datafile.sh   # A shell script that updates /datafile.json with\n                              # the contents of the appropriate datafile on\n                              # cdn.optimizely.com\n\n        /templates/index.html     # a flask template for a simple web page, rendered by\n                                  # application.py\n\n        /templates/performance_observer.html    # a flask template containing a simple google script\n                                                # for tracking TTI\n\n        /templates/optimizely_tti_tracking.html     # additional TTI tracking code and code for\n                                                    # sending an Optimizely \"tti\" event\n\n        /templates/optimizely_web_snippet.html    # a flask template for the Optimizely\n                                                  # Web snippet\n\n## Deploying the application\n\n1. Create and run a [virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/)\n2. Install requirements: `pip install -r requirements.txt`\n3. Run the application `python application.py` (be sure the virtualenv is running)\n4. You’re all set. To try this with your own Optimizely projects, modify `FULL_STACK_PROJECT_ID` and `WEB_PROJECT_ID` in `application.py`.\n\nOnce you're up and running, you can load the page via\n\n      http://localhost:4001/\n\n## Updating the local Full Stack datafile\n\nTo simplify the implementation, `application.py` is configured to load the Full Stack datafile from `./datafile.json` in the local filesystem rather than downloading directly from `cdn.optimizely.com`. To refresh the contents of this file and update your running app, run:\n\n        ./update_datafile.sh \u003cYOUR SDK KEY\u003e\n\nusing your [SDK Key](https://help.optimizely.com/Set_Up_Optimizely/Access_the_datafile_for_a_Full_Stack_project).  \n\nNote: After making changes in your Full Stack project, you may need to wait a minute for your changes to propagate to Optimizely's CDN.  To ensure that your changes are correctly loaded, double-check that the revision number shown on `http://localhost:4001/refresh` matches the revision number shown in your Full Stack project settings.\n\n## The Snippet Configuration Full Stack Project\n\nHere's a rough schema for the \"Snippet Configuration\" Full Stack project this application depends on:\n\n      Full Stack \"Snippet Configuration\" Project\n        Feature: snippet_config\n          Variable: snippet_url (default value: \"https://cdn.optimizely.com/js/11903751716.js\")\n          Variable: is_snippet_synchronous (default value: True)\n\n![](images/snippet_config.png)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptimizely%2Fsnippet-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptimizely%2Fsnippet-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptimizely%2Fsnippet-config/lists"}