npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@contentsquare/tag-sdk

v1.0.2

Published

ContentSquare tag SDK

Downloads

20

Readme

Contentsquare TAG SDK

This NPM package offers developers a standardized way of loading Tracking TAG in a non-blocking way from remote servers. Based on the Contentsquare SDK.

Contentsquare is an analytics platform that helps businesses understand and optimize user experiences on their websites and mobile apps. It provides actionable insights through heatmaps, session recordings, and behavioral analytics, allowing businesses to identify areas for improvement and enhance overall website performance. With its user-friendly interface and powerful data visualization, Contentsquare enables data-driven decision-making to boost conversions and enhance customer engagement.

Installation

Install the package using NPM:

npm install --save @contentsquare/tag-sdk

How to Use Contentsquare Tag

Prerequisites

Before using the Contentsquare tag, make sure you have the following:

  • Contentsquare Account: Client id is required. To obtain client id please visit the official website (https://www.contentsquare.com/).

Steps to Use Contentsquare Tag

Follow the steps below to use the Contentsquare tag on your website:

  1. Include the Contentsquare Script: In your website's Javascript/Typescript, add the Contentsquare script using the provided client ID. Replace YOUR_CLIENT_ID with your actual Contentsquare client ID.

    Call the injectContentsquareScript function with the necessary options to append the Contentsquare script to the document.head.

    // Replace 'YOUR_CLIENT_ID' with your actual Contentsquare client ID
    injectContentsquareScript({
      clientId: 'YOUR_CLIENT_ID',
      async: true, // Optional: Set to false to wait for script execution until after document parsing.
      defer: false, // Optional: Set to true to defer script execution after document parsing.
      integrity: 'YOUR_SCRIPT_INTEGRITY_HASH', // Optional: Provide the integrity hash for script security (if required).
    });

    The function will append the Contentsquare script to the document.head, and it will be fetched and executed accordingly based on the provided options.

  2. Usage: Please refer to the Contentsquare documentation for more information on using the Contentsquare tag.


API Reference

injectContentsquareScript(scriptOptions)

Injects the Contentsquare script into the document.head.

  • scriptOptions: Options for injecting the script.
    • clientId (string) - (Required) The client ID provided by Contentsquare in the form of 'a6f73d509'.
    • defer (boolean) - (Optional) Indicates if the script is fetched in parallel and evaluated after the document is parsed. Defaults to false.
    • async (boolean) - (Optional) Indicates if the script is fetched in parallel and evaluated as soon as possible. Defaults to true.
    • integrity (string) - (Optional) The integrity hash (SRI) of the Contentsquare script. Must be generated by Contentsquare.

Returns: The script element representing the Contentsquare script that was appended to document.head. Can be used for further manipulation or tracking loading state.

Restrictions

  • This bootstrap mode will only be available for the modern “Contentsquare Deployment” mode (no support for Clicktale or any other legacy modes).
  • Some functions within the package will include inline descriptions/types for ease of use, but not all functionality is covered. Please refer to the official Contentsquare documentation for more information on the available functions and their usage.