Skip to content

Google Tag Manager template for detecting front-end Algolia search metrics

License

Notifications You must be signed in to change notification settings

algolia/search-insights-gtm

Repository files navigation

Search Insights for Google Tag Manager (GTM)

Google Tag Manager connector for Algolia Search Insights.

Documentation

Head over our Getting Insights and Analytics / Google Tag Manager documentation.

Contributing

Before working on the project, make sure to disable any ad blockers.

Folder structure

The source for the GTM template is in the src/ folder and gets exported to the ./template.tpl file.

Commands

build

Builds the GTM template into the ./template.tpl file.

Each section of the custom template is in the src/ folder. This command compiles the files into a GTM template.

dev

Runs the build command in watch mode.

Releasing

The TEMPLATE_VERSION variable in the sandboxed JavaScript should be incremented for each change. This variable is used to send usage metrics to Algolia.

To release a new version:

  • Run the build command to update the generated template
  • Commit the change (git commit -m "chore: update version to vx.y.z")
  • Run the release command to update metadata.yml file with the commit SHA.
  • Update the changelog manually (and probably changeNotes in metadata.yml as well)
  • Commit it to GitHub

For users to update the template, they need to download it again and to reimport it in the GTM interface (they won't lose their configuration).

Credits

Thanks to David Vallejo for his initial work on the custom template.

License

Apache 2.0 - See LICENSE for more information.