- Create custom snippets for your Optimizely Web Experimentation projects
- View and manage custom snippets
Custom snippets allow you to decide what projects and pages go into your snippet. Custom snippet permissions are based on the collaborator role. If the custom snippet feature is enabled for your account, all collaborators can view your account's snippets and copy snippet codes.
Administrators can create, edit, and archive custom snippets for any project in their accounts.
Project Owners can create custom snippets for their projects. They can also edit and archive custom snippets—as long as they have owner permissions on all of the projects included in the snippet. For example, to edit or archive a custom snippet that includes multiple projects, a user must be a Project Owner for every project in the snippet.
Create a custom snippet
Here is how to create a custom snippet for your projects:
If you want to include more than one project in your custom snippet, confirm that all of the projects you want to include are linked projects.
Navigate to Settings > Implementation and click Create Custom Snippet...
Administrators can also access custom snippets by navigating to Account Settings > Snippets and clicking Create Custom Snippet...
In the Create Custom Snippet dialog, specify the settings you want for the snippet.
See Custom snippet option below for more information about the settings you can choose.
Custom snippet options
Name: User-friendly name for the custom snippet; appears in the dashboard and elsewhere in the UI
Key: Unique snippet identifier that's included in the snippet URL; must be unique to the account
Description: Optional summary of how the snippet is generated and where it will go
Type: Choose whether the snippet is for a single project or for linked projects
Project: Specific projects the snippet should pull from (for linked projects); default is a single-project snippet for the current project
Pages: Pages to include and exclude from the snippet (default is to include all pages in the project)
Include URL and Exclude URL: URLs to include, exclude, or both (depending on your Pages selections)
Matching criteria: match to URL (snippet will include or exclude the specified URL) or match to substring (snippet will include or exclude any page that matches the specified substring); see Custom snippet matching criteria for details
jQuery Inclusion: Version of JQuery to include with the snippet; should be the same version specified in your project settings
Privacy: Desired privacy settings
View and manage custom snippets
Administrators can view and manage all custom snippets for their accounts by navigating to Account Settings > Snippets.
All collaborators can view snippets for the current project by navigating to Settings > Implementation. As long as the project has at least one custom snippet, you'll see a dashboard that lists all basic and custom snippets that are associated with the project.
Administrators and Project Owners can click a custom snippet name to edit the snippet settings. They can also archive custom snippets by clicking the icon. Remember, Project Owners must be owners of all projects included in a custom snippet to edit or archive the snippet.