This is the Google Tag Manager custom template for the Snowplow Analytics JavaScript tracker.
The Snowplow Analytics tag template lets you deploy, implement, and configure the Snowplow Analytics JS tracker on the website using Google Tag Manager.
It has been designed to be used with the Snowplow Analytics Settings custom variable template.
Work on the template should be done in Google Tag Manager's native template editor. This is to ensure the template has access to all the latest features of the template editor, and to make sure it passes GTM's own validation when exporting the changes.
To import the template into Google Tag Manager:
- In a Google Tag Manager web container (any container will do), browse to Templates and click to create a new template.
- From the template action menu, choose Import.
- Locate the
template.tpl
file from this repo, and import it into the template editor.
Make the changes you wish. Make sure the unit tests pass (in the Tests tab of the editor). Update the tests if necessary.
Once you're done, follow these steps:
- Save the template in the template editor.
- From the action menu, choose Export.
- Replace the
template.tpl
file in this repo with the exported file (make sure to keeptemplate.tpl
as its name).. - Commit the changes to the
template.tpl
file. - Copy the commit hash.
- Edit
metadata.yaml
in the template folder, and add the hash with itschangeNotes
as the latest version. - Move the previous latest version into the list of
Older versions
. - Save changes to
metadata.yaml
and commit them. - Finally, push the changes to the repo (should include the commit to
template.tpl
and the commit tometadata.yaml
).
After pushing the changes, Google Tag Manager should update the template in the community gallery within some hours to some days.
Tag Template |
---|
Technical Docs |
Significant portions copyright 2020 Simo Ahava. Remainder copyright 2020 Snowplow Analytics Ltd. All rights reserved.
Licensed under the [Apache License, Version 2.0][license] (the "License"); you may not use this software except in compliance with the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.