Skip to content

Commit

Permalink
Add changelog, fix weird build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
derrickreimer committed Jun 13, 2024
1 parent c4a6e58 commit b88e4a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 3.7.0

- Make the `load` function idempotent
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ This library is a JavaScript client for [Fathom Analytics](https://usefathom.com

Maintained with ♥️ by the [SavvyCal](https://savvycal.com/?utm_source=github&utm_medium=oss&utm_campaign=fathom-client) team

[![sc-sticker](https://user-images.githubusercontent.com/341387/150855440-1a4122b4-b3c9-47b5-91ff-c0d73f421f84.svg)](https://savvycal.com/?utm_source=github&utm_medium=oss&utm_campaign=fathom-client)

## Installation

Run the following to install in your project:
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type EventOptions = {

/**
* @see https://usefathom.com/support/tracking-advanced
**/
**/
export type LoadOptions = {
url?: string;
auto?: boolean;
Expand Down Expand Up @@ -122,7 +122,7 @@ const checkDomainsAndWarn = (domains: string[]): void => {

/**
* Loads the Fathom script.
*
*
* @param siteId - the id for the Fathom site.
* @param opts - advanced tracking options (https://usefathom.com/support/tracking-advanced)
*/
Expand All @@ -143,7 +143,8 @@ export const load = (siteId: string, opts?: LoadOptions): void => {
tracker.id = 'fathom-script';
tracker.async = true;
tracker.setAttribute('data-site', siteId);
tracker.src = opts?.url || 'https://cdn.usefathom.com/script.js';
tracker.src =
opts && opts.url ? opts.url : 'https://cdn.usefathom.com/script.js';

if (opts) {
if (opts.auto !== undefined)
Expand Down

0 comments on commit b88e4a8

Please sign in to comment.