Iframe

Configure

Iframe installations run one SeekaFrameInit per instance. Each instance injects its own hidden iframe and is interacted with via its own variable, unlike script tag and NPM installations which configure all instances in a single install.

To get the organisation ID, instance ID, and public key for each instance, visit API settings in the Seeka app. Make sure the correct organisation and brand is selected before copying the values.

<script>
    // 1. Copy the install script tag from https://seeka.app/setup/sources/iframe-install
    // 2. Keep the script bundle that defines SeekaFrameInit - it only needs to be included once
    // 3. Replace the single window.Converge = new SeekaFrameInit(...).init() call with one call per instance:

    // Brand 1
    window.ConvergeBrand1 = new SeekaFrameInit(
        '', // Organisation ID
        '', // Public key
        '', // Instance ID of brand 1
        false, // set to false in production - enables tracked events to end up in server diagnostic streamer inside seeka app
        '', // Enables logging to javascript console. either information, warning, error, verbose - set to '' in production
        'https://sdk.seeka.services', // Host
        '<your software name>', // Client name - the name of your software
        '<your software version>' // Client version - the version of your software build or integration
    ).init();

    // Brand 2
    window.ConvergeBrand2 = new SeekaFrameInit(
        '', // Organisation ID
        '', // Public key
        '', // Instance ID of brand 2
        false,
        '',
        'https://sdk.seeka.services',
        '<your software name>',
        '<your software version>'
    ).init();
</script>

The instance ID must be unique for each instance - it scopes the iframe that each instance injects and delivers its events through.

Usage

Each .init() call returns an independent SDK for that instance. Unlike script tag and NPM multi-instance installs, there is no shared Converge.instances registry and no all-instance dispatch: to fire an event across every brand, call the method on each instance.

// Track an order for brand 1 only
window.ConvergeBrand1.track.order({
  orderId: "ORD-123",
  totalPrice: 99.95,
  currency: "AUD",
});

// Merge identity across both brands
const profile = {
  email: ["john.smith@example.com"],
};
window.ConvergeBrand1.identity.mergeProfile(profile);
window.ConvergeBrand2.identity.mergeProfile(profile);

See the method reference for all available methods.

Software vendors

If you are a software vendor installing Seeka on behalf of your customers, declare your software name and version on every instance via the last two parameters of SeekaFrameInit, as shown in the example above. If you are installing Seeka on your own site rather than on behalf of software customers, omit both parameters.

See software vendors on the iframe install page for details, including length limits and how the client is recorded.

Noteworthy

  • Each instance loads its own hidden iframe with its own copy of the SDK, so keep the number of instances on a page small.
  • Browser hooks are bubbled up from each iframe into the top window.
  • For instances that are created and destroyed at runtime, see dynamic multi-instance.