### Gorgias HTTP Integration Setup Source: https://docs.zigpoll.com/integrations/gorgias Steps to create an HTTP integration in Gorgias to connect with Zigpoll, enabling display of customer data within tickets. Requires a Zigpoll integration link and configuration of triggers and data mapping. ```APIDOC Gorgias HTTP Integration for Zigpoll: This process outlines how to configure Gorgias to receive and display data from Zigpoll. 1. **Obtain Zigpoll Integration Link**: * In Zigpoll: Navigate to Settings -> Manage Integrations. * Enable the Gorgias Integration. * Copy the generated integration link. This link is essential for configuring Gorgias. 2. **Create HTTP Integration in Gorgias**: * Navigate to Gorgias: Settings -> Integrations -> HTTP Integrations. * Click 'Add Integration'. * **Configuration Parameters**: * `Name`: A descriptive name for the integration (e.g., 'Zigpoll Data'). * `Description`: A brief explanation of the integration's purpose. * `HTTP Method`: Specify the HTTP method required by Zigpoll (typically POST or GET, consult Zigpoll documentation if unsure). * `Headers`: Any necessary headers for authentication or content type (e.g., `Content-Type: application/json`). These are usually provided by Zigpoll. * `URL`: Paste the integration link obtained from Zigpoll in Step 1. * **Triggers**: * Select 'Ticket created' and 'Ticket message created' to ensure data is processed when relevant events occur. * **Save Integration**: * Click 'Add Integration' to save the configuration. 3. **Map Zigpoll Data in Gorgias Tickets**: * Once a ticket is received containing third-party data from Zigpoll: * Open the ticket. * Locate the gear icon on the right side of the page. * Drag the new Zigpoll information (e.g., satisfaction reports, survey data) into the infobar. * Select 'Save' to finalize the mapping. **Outcome**: After successful setup, Zigpoll customer information will be visible directly within Gorgias tickets, alongside other ticket data. ``` -------------------------------- ### Zigpoll Basic Embed Script Source: https://docs.zigpoll.com/embed The fundamental JavaScript code to embed Zigpoll into your website. This script initializes the Zigpoll object with your account ID and dynamically injects the Zigpoll tracking script into the document's head. Replace YOUR_ACCOUNT_ID with your actual account identifier. ```javascript ``` -------------------------------- ### Zigpoll SPA Refresh Method Source: https://docs.zigpoll.com/embed For Single Page Web Applications (SPAs), this JavaScript command should be executed after a route or view change. It calls the `window.Zigpoll.refresh()` method to ensure Zigpoll is updated correctly on the new view, maintaining seamless integration without a full page reload. ```javascript window.Zigpoll.refresh(); ``` -------------------------------- ### Zigpoll Embed Script with Poll ID Source: https://docs.zigpoll.com/embed This JavaScript snippet demonstrates how to embed Zigpoll and load a specific poll using the `pollId` parameter. By setting `pollId` in the `window.Zigpoll` object, you can override default display rules and load a particular poll, useful for targeted content delivery on specific pages. ```javascript ``` -------------------------------- ### Javascript: Execute Code on Zigpoll Load Source: https://docs.zigpoll.com/javascript-api Assign a function to the `window.Zigpoll.onload` property to execute custom behavior immediately after the Zigpoll has finished loading on the page. This is useful for initializing scripts or triggering actions once Zigpoll is ready. ```javascript window.Zigpoll.onload = function () { console.log('Zigpoll loaded'); } ``` -------------------------------- ### Public Link with Dynamic Parameters Source: https://docs.zigpoll.com/public-link Shows how to dynamically add query parameters to a public survey link, useful for embedding surveys in emails and tracking customer-specific data like IDs from e-commerce platforms. ```web https://share.zigpoll.com/ACCOUNT_ID/POLL_ID?shopify_customer_id={{ customer.id }}&shopify_order_id={{ order.id }} ``` -------------------------------- ### Setting Template Variables in Zigpoll Source: https://docs.zigpoll.com/embed/template-variables This JavaScript code snippet demonstrates how to define template variables for Zigpoll slides. It maps placeholder names (e.g., 'first_name') to specific data values, allowing dynamic content insertion into slides. This is crucial for personalizing user experiences. ```javascript ``` -------------------------------- ### Set Zigpoll Template Variables with JavaScript Source: https://docs.zigpoll.com/slides/template-variables Demonstrates how to define template variables like 'name' in JavaScript, often populated from backend data (e.g., PHP), to be used within Zigpoll slides. This allows for dynamic content personalization. ```javascript // Add this code right below your Zigpoll embed code. window.Zigpoll.templateVariables = { name: } ``` -------------------------------- ### Track Survey Metadata with JavaScript Source: https://docs.zigpoll.com/embed/poll-metadata This snippet demonstrates how to set the window.Zigpoll.metadata object to include custom information with your survey. It should be placed on the page before the Zigpoll embed code loads to ensure the metadata is captured. ```javascript ``` -------------------------------- ### Public Link with Metadata Tag Source: https://docs.zigpoll.com/public-link Demonstrates how to append a query parameter to a public survey link to tag respondents with specific metadata, such as an email survey identifier. ```web https://share.zigpoll.com/ACCOUNT_ID/POLL_ID?tag=email_survey ``` -------------------------------- ### Add Participant Metadata to Zigpoll Source: https://docs.zigpoll.com/embed/participant-metadata This JavaScript snippet demonstrates how to set custom user data, including metadata like first name, last name, and email, for a participant within the Zigpoll embed code. This allows for enhanced tracking and personalization of poll responses by associating specific attributes with each participant. ```javascript ``` -------------------------------- ### Use Handlebars for Conditional Text in Zigpoll Slides Source: https://docs.zigpoll.com/slides/template-variables Shows how to access template variables (e.g., 'name') within Zigpoll slide copy using Handlebars syntax for conditional display, falling back to a default value if the variable is not present. Supports loops and conditional logic via the Handlebars specification. ```handlebars Hey, {{#if name}}{{name}}{{else}}Mysterious Person{{/if}} do you have a minute to fill out our survey? ```