MyGig

MyGig tag

MyGig partners send people to your website. The tag is a short piece of code that tells MyGig when one of them arrives, so the partner who sent them gets the credit. It ignores everyone else who visits.

  1. Copy the tag

    This short piece of code is the whole tag. Copy it exactly as it is.

    MyGig tag
    <script>window.mygig=window.mygig||function(){(window.mygig.q=window.mygig.q||[]).push(arguments)};</script>
    <script async src="https://api.dev.joinmygig.com/api/v1/t/mygig.js" data-partner-tags="meta,ga4"></script>
  2. Add it to every page of your website

    If someone else looks after your website, send them this page. It takes them a few minutes.

    If you manage the site yourself, your website builder has a place for code like this. Paste the tag there and save.

    Website builderWhere the tag goes
    WordPressInstall the free WPCode plugin. Open Code Snippets › Header & Footer and paste the tag into Header.
    WixSettings › Custom Code › Add Custom Code. Paste the tag, then choose All pages and Head.
    SquarespaceWebsite › Pages › Custom Code › Code Injection. Paste the tag into Header.
    ShopifyOnline Store › Themes › Edit code › theme.liquid. Paste the tag on the line above </head>.
    WebflowSite settings › Custom code. Paste the tag into Head code, save, then publish the site.
    Any other siteAdd the tag to the template every page shares, just before </head>.

    Menu names as of October 2026. Wix, Squarespace and Webflow allow added code on paid plans only.

  3. Check that it works

    MyGig sends you a test link. Open it once, in any browser. Your site looks the same as before. Your MyGig contact sees the visit arrive and tells you the tag is working.

What the tag records

The tag acts only when a visitor arrives through a MyGig partner's link. It records the visit, never who the visitor is.

Kept in the visitor's browser

  • A random visitor number
  • The first referral code and link they arrived with, and when
  • That partner's public ad tag ids

Sent to MyGig

  • That visitor number
  • The page they landed on, without anything after the ?
  • The referral code in the address
  • A one-way scramble of the IP address, not the address itself
  • The browser and device type (its user agent)
  • The site they came from, by its address only
  • Each action you report, with its value

Never recorded

  • Names
  • Email addresses
  • Phone numbers
  • What visitors type into forms
  • Anything after the ? in a page address

In the browser this is one entry named mygig_visitor in local storage. When local storage is unavailable it is a first-party cookie of the same name, kept up to 400 days.

Record leads, signups and purchases

On its own the tag records visits. To also record what a referred visitor does next, add one line of code where it happens. This part needs someone who can edit the site's code.

NameSend it whenShows in MyGig as
leadA visitor sends a form so you can follow up: a quote, an application, a callback request.Lead form sent
sign_upA visitor creates an account.Signed up
purchaseA visitor pays or completes an order.Purchase
contactA visitor starts a call, chat, text or email with you.Contact request
When a visitor sends a lead form
mygig('event', 'lead');
When a visitor pays, with the amount
mygig('event', 'purchase', { value: 120.5 });
  • Call mygig('event', name) once the action has happened. The tag sends it only for visitors a MyGig partner referred, and keeps calls made before it has loaded.
  • value is in US dollars, up to two decimal places. Leave it out when there is none.
  • Any other name works too: lowercase snake_case, starting with a letter, up to 40 characters (demo_booked). It shows in MyGig as sent.
  • A purchase reported here is a signal only. Sales are still confirmed the usual way, with the referral sent as below.

Send the referral with each sale

If your system posts sales to MyGig (POST integrations/transactions), ask the tag for the visitor's referral at checkout and send it with the sale. This part needs someone who can edit the site's code.

At checkout, before the order is saved
mygig('referral', function (referral) {
  // null when no MyGig partner referred this visitor,
  // else { visitorId, cr }: keep both with the order
});
  • Send cr as the sale's cr: the code of the partner who referred this visitor first on your site. cr decides who the sale credits.
  • Send visitorId as visitor_id. It is optional. It links the sale to the visit it came from and never changes who the sale credits.
  • The tag answers once this page's visit is recorded, also for a call made before it loaded. When it answers null, send the sale as you do today, without visitor_id.

For developers

Most sites need none of this. Open what applies to yours.

Editing the tagWhat to keep if you write the two lines by hand
  • Paste both lines before </head> on every page, so the tag sees a referred visitor arrive and what they do on later pages.
  • Keep async: the tag never holds up the page.
  • Do not add crossorigin or type="module" to either line.
Partners' own ad tagsWhich of a partner's ad and analytics tags may load on your pages

The partner who referred a visitor can have their own ad and analytics tags load for that visitor. data-partner-tags on the second line says which may load. Leaving it out means meta,ga4.

Meta pixel and Google Analytics 4 (the default)
data-partner-tags="meta,ga4"
Meta pixel, Google Analytics 4 and Google Tag Manager
data-partner-tags="meta,ga4,gtm"
No partner tags
data-partner-tags="none"

Allowing gtm lets a partner's Tag Manager container run its own code on your pages, where it can read what visitors type. List it only if you accept that.

If your site runs its own Meta pixel: while meta is allowed, your own fbq('track', …) calls also reach the referring partner's pixel, for the visitors that partner sent. To keep your events to your own pixel, either leave meta out of data-partner-tags, or send your own events with trackSingle and your pixel id in place of YOUR_PIXEL_ID.

Leave meta out
data-partner-tags="ga4"
Or send your own events to your pixel only
fbq('trackSingle', 'YOUR_PIXEL_ID', 'Lead');
Content-Security-PolicySources to allow, if your site sends this header

Add each source below to the directive of the same name. The MyGig tag needs the first box on every site. Add the others only for the partner tags data-partner-tags allows.

The MyGig tag, always
script-src https://api.dev.joinmygig.com;
connect-src https://api.dev.joinmygig.com;
Meta pixel, when meta is allowed
script-src https://connect.facebook.net;
connect-src https://www.facebook.com;
img-src https://www.facebook.com;
Google Analytics 4 and Tag Manager, when ga4 or gtm is allowed
script-src https://*.googletagmanager.com;
connect-src https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com;
img-src https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com;
  • These are the hosts the partner tags use as of October 2026.
  • Google keeps its own list in its Content Security Policy guide, which adds more hosts for sites that use Google signals. Meta publishes no list of its own.
  • If the policy blocks any other host, the browser console names it.
  • The first line of the tag is an inline script. A policy without 'unsafe-inline' needs a nonce or hash on it.
  • A partner's Tag Manager container may load other sources of its own.
Cookie consentWhat to do if your site asks visitors before tracking

The tag does not wait for a cookie consent banner. If the site asks visitors for consent, add the tag only after they give it.