Home Widget Integration
πŸ—οΈ

Widget Integration

Anenth
By Anenth and 1 other
β€’ 3 articles

Integrating Premagic Widgets into Your Event Site

Premagic offers three drop-in features that boost attendee engagement and help you measure ROI on advocate-driven ticket sales. This guide walks you through integrating them using our open-source sample apps. What you get - LoginWidget β€” LinkedIn "Quick Register" button + automatic form autofill. Place it on your registration / sign-up page. - PosterWidget β€” Personalised attendee poster creator + social sharing. Place it on your success / confirmation page. - Advocate Revenue Tracking β€” Attribute ticket sales to the advocate who shared the poster. Place it on your checkout / payment success page. Sample apps We maintain a public sample repo with complete, runnable apps for the three most common frameworks: Repo: https://github.com/premagic/example-premagic-poster-widget - React 18 β€” folder react/ β€” cd react && npm install && npm start - Angular 17+ β€” folder angular/ β€” cd angular && npm install && npm start - Vue 3 β€” folder vue/ β€” cd vue && npm install && npm run dev Each sample contains a 4-page flow (Home β†’ Register β†’ Success β†’ Profile) so you can see every widget in context. Step 1 β€” Add the tracking scripts Add these two tags to the <head> of every page of your site. They are required for all three features. <link rel="preload" href="https://asts.premagic.com/s/poster-widget/premagic-poster-widget.js" as="script" crossorigin="anonymous" /> <script src="https://asts.premagic.com/s/poster-conversion-tracker/ptm.js"></script> Step 2 β€” Configure your shareId All you need is your Premagic share ID: const premagicConfig = { shareId: "YOUR_SHARE_ID" // Required }; Note: projectId, eventId, websiteId, and domain have all been removed. Do not include them. Step 3 β€” Drop the widgets into your pages LoginWidget β€” on your registration page import LoginWidget from './premagic-widgets/LoginWidget'; function RegistrationPage() { return ( <div> <h1>Register</h1> <LoginWidget config={{ shareId: "YOUR_SHARE_ID" }} /> {/* Your registration form below */} </div> ); } The LoginWidget will autofill name, email, company and job title from the user's LinkedIn profile. PosterWidget β€” on your success page import PosterWidget from './premagic-widgets/PosterWidget'; function SuccessPage() { return ( <div> <h1>Registration Successful!</h1> <PosterWidget config={{ shareId: "YOUR_SHARE_ID" }} /> </div> ); } Equivalent Angular and Vue components are in the corresponding folders. Step 4 (optional) β€” Track revenue from poster shares When someone clicks an advocate's shared poster link and later completes a purchase, call trackPurchase on your checkout success page so we can attribute the sale: window.AdvocateTracking.trackPurchase({ orderId: '12345', // Your unique order ID orderCount: 2, // Number of tickets / items value: 100.00, // Total value (number, no currency symbol) currency: 'USD' // ISO 4217 (USD, EUR, GBP, EGP, …) }); This is plain JavaScript β€” no framework wrapper required. Calls from non-referred purchases are safely ignored. Already have user data? Skip the LinkedIn login For attendee profile pages, post-purchase confirmation, or exhibitor dashboards where the user is already logged into your system, pass prefillData to the PosterWidget to go straight to poster creation: const premagicConfig = { shareId: "YOUR_SHARE_ID", prefillData: { externalId: "ext_12345", userName: "John Doe", userTitle: "Senior Developer", userCompany: "Acme Corp", userPhoto: "https://example.com/photo.jpg", email: "john@example.com", phone: "+1234567890", registrationId: "reg_12345", sessionTitle: "Conference 2025", exhibitorLogo: "https://example.com/logo.jpg", exhibitorBoothNumber: "101" } }; All prefillData fields are optional β€” pass only what you have. Each sample app includes a /profile page demonstrating this pattern. Important notes - Container ID must be widget-premagic β€” both widgets render into <div id="widget-premagic"></div>. - Always call cleanup β€” call unmountWidget() on component unmount/destroy to prevent memory leaks. The sample components do this for you. - Framework form autofill needs polling. React, Angular and Vue do not detect programmatic DOM .value changes. To capture autofilled data on form submit, poll the inputs every 500 ms and sync them into your form state. See the autofill sync section in LLM_GUIDE.md for the exact pattern. Working with AI assistants (Cursor, Copilot, ChatGPT, Windsurf, Codex) The repo includes ready-to-feed integration guides for AI coding assistants: - Root: LLM_GUIDE.md β€” full integration reference - React: react/LLM_GUIDE.md - Angular: angular/LLM_GUIDE.md - Vue: vue/LLM_GUIDE.md Just paste the relevant guide into your AI assistant β€” it has everything needed to generate working integration code. Need help? - Issues / feature requests: https://github.com/premagic/example-premagic-poster-widget/issues - Questions: Reply to this article or contact your Premagic account manager.

Last updated on May 11, 2026

Troubleshooting Conversion Tracking with Advocacy Posters when your event website and registration form are on different domains

This guide explains how to enable end-to-end conversion tracking for registrations driven by Premagic advocacy posters when your event website and registration form are hosted on different domains. Why Conversion Tracking Is More Complex Standard campaign tracking (using UTMs) usually measures which campaign or platform drove traffic. Tools like Google Analytics track fields such as: - Source - Medium - Campaign This allows you to see which marketing channel drove the visit. Premagic tracking works differently because it tracks individual advocates, not just campaigns. Instead of knowing that β€œLinkedIn drove the registration,” the goal is to know exactly which person’s poster generated that registration. To do this, Premagic passes a unique tracking parameter called pkey through the entire user journey. This parameter must remain intact from the moment someone clicks a poster until they complete registration. The journey looks like this: - Poster click - Event website landing page - Registration form - Premagic attribution If the pkey parameter is lost anywhere in this journey, the registration cannot be attributed to the correct advocate. The Common Issue: Cross-Domain Tracking Many events host their marketing website and registration forms on different domains. For example: - Event website: - Registration form: Because these are separate domains, the tracking parameter can get lost during redirects between pages. Here is how the current flow typically works: - An attendee clicks the link on a LinkedIn advocacy poster - They land on /?pkey=<tracking_code> - Premagic reads the pkey value from the URL to attribute the visit - The attendee clicks Register Now - They are redirected to another domain - During this redirect, the pkey parameter is dropped, which breaks attribution There are usually two separate issues that cause this behavior. Issue 1: The pkey Parameter Is Not Passed to Register Links Many event homepages include multiple Register Now buttons. These buttons typically link to the registration page but do not include the pkey parameter that was originally present in the landing page URL. To fix this, the homepage needs a small script that: - Reads the pkey value from the URL - Automatically appends it to all Register Now links on the page This ensures that when a visitor clicks a Register button, the link carries the tracking parameter forward to the next page. For example, instead of sending visitors to: <event website domain>/registration-redirect The link should become: <event website domain>/registration-redirect?pkey=<tracking_code> Your development team can implement the following script before the closing tag or deploy it through Google Tag Manager. <script> (function () { var pkey = new URLSearchParams(window.location.search).get("pkey"); if (!pkey) return; document.querySelectorAll('a[href*="registration-redirect"]').forEach(function (a) { var url = new URL(a.href, window.location.origin); url.searchParams.set("pkey", pkey); a.href = url.toString(); }); })(); </script> This script detects the pkey parameter on the landing page and ensures that every relevant registration link automatically includes it. Issue 2: Redirects Dropping the pkey Parameter Even after the first fix is applied, another issue can still prevent proper tracking. Many registration buttons use a short redirect URL such as: <event website domain>/registration-redirect This URL then redirects visitors to the final registration page, for example: <registration platform domain>/?utm_source=...&utm_medium=... The problem is that this redirect currently ignores additional parameters like pkey. As a result, even if the parameter is added to the first URL, it gets dropped before reaching the final registration form. To resolve this, the redirect logic for the registration redirect page needs to be updated so it: - Detects the pkey parameter from the incoming request - Passes the parameter through to the final destination URL For example, the final redirect should include the parameter, resulting in a destination like: <registration platform domain>/?pkey=<tracking_code>&utm_source=... Final Outcome Both fixes must be implemented for full end-to-end conversion tracking to work: - Fix 1: Homepage script to pass pkey from the landing page to all Register links - Fix 2: Update redirect logic to pass pkey from the redirect page to the final registration form Once both fixes are in place, Premagic will be able to accurately attribute registrations to the specific advocate who shared the poster.

Last updated on Mar 10, 2026

Customize the quick register buttons

The Premagic event widget shows two login buttons on its registration screen a LinkedIn button and an Email button. You can restyle both to match your brand by dropping a small CSS snippet into your event's custom CSS field. This article lists every color, padding, and radius you can override, and includes a ready-to-use prompt you can paste into ChatGPT / Claude / any LLM to generate the CSS for you automatically. What you can customize - LinkedIn button: background color, icon badge color, text color, hover colors - Email button: background color, text color, hover colors, padding, font size, border radius What you can't customize (today) - The button layout / order on the page - The button copy (use the widget text settings instead) - Adding other social providers, LinkedIn is the only social login supported right now Where the CSS goes You add this CSS on your own website β€” the site where the Premagic widget is embedded. Drop it into a <style> tag in your site's <head>, or add it to your site's global stylesheet, right alongside your other custom styles. Scope all the style under a class name which is added on your page(eg. .your-class ) so that all the style has a higher specificity πŸ€– Let an AI design it for you Copy the entire block below into ChatGPT, Claude, or your LLM of choice. At the bottom, replace the <fill this in> line with your brand colors (or a description like "modern, navy + coral"). The LLM will return a CSS snippet you can paste straight into your widget's Custom CSS field. You are helping me design the login buttons on my Premagic event registration widget. Produce a single CSS block that overrides the CSS custom properties listed below. Rules: - Do NOT invent class names. Only use the selectors listed. - Do NOT restyle anything outside the two buttons. - Ensure sufficient contrast between text and background (WCAG AA). - Output only the final CSS. No explanation. ## Buttons on the page 1. LinkedIn social button β€” `.premagic-social-button--linkedin` 2. Email button β€” `.premagic-button-email` Selectors you may target: | Button | Selector | |----------------|-----------------------------------------------------| | LinkedIn | `.premagic-social-button--linkedin` | | LinkedIn icon | `.premagic-social-button__icon` | | LinkedIn text | `.premagic-social-button__text` | | Email | `.premagic-button-email` | ## Social button variables | Variable | Default | Effect | |---------------------------------------------|-----------|-----------------------| | `--premagic-social-button-bg` | `#0655a6` | Background | | `--premagic-social-button-color` | white | Text color | | `--premagic-social-button-icon-bg` | `#0b66c3` | Icon badge background | | `--premagic-social-button-icon-color` | white | Icon color | | `--premagic-social-button-hover-bg-color` | `#054c93` | Hover background | | `--premagic-social-button-hover-text-color` | white | Hover text color | ## Email button variables (set on `.premagic-button-email`) | Variable | Effect | |--------------------------------------|----------------------| | `--premagic-button-bg-color` | Background | | `--premagic-button-text-color` | Text color | | `--premagic-button-hover-bg-color` | Hover background | | `--premagic-button-hover-text-color` | Hover text color | | `--premagic-button-shadow-color` | Hover box-shadow | | `--premagic-button-border-radius` | Corner radius (8px) | | `--premagic-button-font-size` | Font size | You may also set `padding` directly on `.premagic-button-email`. ## Built-in tokens you can reuse - Colors: `--premagic-color-white`, `--premagic-color-black`, `--premagic-color-gray-darker|dark|β€”|light|lighter|lightest`, `--premagic-color-blue-dark|β€”|light|lightest` - Spacing: `--premagic-spacing-1..8` (4px steps) - Radius: `--premagic-border-radius` (8), `-md` (12), `-lg` (16) ## Example output format ```css :root { --brand-primary: #3b2e79; --brand-primary-dark: #190965; } .your-class .premagic-social-button--linkedin { --premagic-social-button-bg: var(--brand-primary); --premagic-social-button-icon-bg: var(--brand-primary-dark); --premagic-social-button-hover-bg-color: var(--brand-primary-dark); } .your-class .premagic-button-email { --premagic-button-bg-color: var(--brand-primary); --premagic-button-text-color: #fff; --premagic-button-hover-bg-color: var(--brand-primary-dark); --premagic-button-hover-text-color: #fff; } here is a example https://codepen.io/Anenth-Vishnu/pen/JoRLBYz

Last updated on Apr 08, 2026