Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
tobostudio.cordova-plugin-tag-manager
Advanced tools
Google Tag Manager plugin for analytics tracking with support for events and pageviews.
Readme
Tag Manager plugin for Android and iOS. It allows you to post usage information to your Google Tag Manager account.
This plugin defines a global TagManager
Constructor.
Although in the global scope, it is not available until after the deviceready
event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(TagManager);
}
When being used in combination with AngularJS, it is recommended to use Angulartics with the Cordova GTM plugin (angulartics-gtm-cordova).
cordova plugin add cordova-plugin-tag-manager
var tagManager = cordova.require('com.jareddickson.cordova.tag-manager.TagManager');
tagManager.init
: Initialize Tag Manager with an account ID and the number of seconds between dispatching analytics.
tagManager.trackEvent
: Log an event.
tagManager.trackPage
: Log a page view.
tagManager.pushEvent
: Pushes any event onto the Data Layer. This is not only reserved for event types.
tagManager.dispatch
: Force an immediate dispatch to Tag Manager.
tagManager.exit
: Exit the TagManager instance and stop setInterval.
Initialize Tag Manager with an account ID and the number of seconds between dispatching analytics.
tagManager.init(success, error, id, [period]);
success: (Optional) The callback to execute if successful.
error: (Optional) The callback to execute if an error occurs.
id: The GTM account ID of the form 'GTM-000000'.
period: The interval for sending tracking events if any exist in the queue.
// Tag Manager
var tagManager = cordova.require('com.jareddickson.cordova.tag-manager.TagManager');
var trackingId = 'GTM-000000';
var intervalPeriod = 30; // seconds
// Initialize Tag Manager
tagManager.init(null, null, trackingId, intervalPeriod);
Log an event.
tagManager.trackEvent(success, error, category, eventAction, eventLabel, eventValue);
success: (Optional) The callback to execute if successful.
error: (Optional) The callback to execute if an error occurs.
category: The event category. This parameter is required to be non-empty.
eventAction: The event action. This parameter is required to be non-empty.
eventLabel: The event label. This parameter may be a blank string to indicate no label.
eventValue: (Optional) The event value. This parameter may be -1 to indicate no value. Only accepts digits.
// Track a click-to-call event
tagManager.trackEvent(null, null, 'Link', 'Click', 'Call (800) 123-1234', -1);
Log a page view.
tagManager.trackPage(success, error, pageURL);
success: (Optional) The callback to execute if successful.
error: (Optional) The callback to execute if an error occurs.
pageURL: The URL of the page view.
// Track a pageview on a Contact Us page
tagManager.trackPage(null, null, '/contact-us');
Force an immediate dispatch to Tag Manager.
tagManager.dispatch([success], [error]);
success: (Optional) The callback to execute if successful.
error: (Optional) The callback to execute if an error occurs.
// Dispatch
tagManager.dispatch();
Pushes any event onto the Data Layer. This is not only reserved for event types.
tagManager.pushEvent([success], [error], eventData);
success: (Optional) The callback to execute if successful.
error: (Optional) The callback to execute if an error occurs.
eventData: Data that will be pushed onto the Data Layer.
// push a variable onto the Data Layer
tagManager.pushEvent(success, error, {'variable_name': 'variable_value'});
Exit the TagManager instance and stop setInterval.
tagManager.exit([success], [error]);
success: (Optional) The callback to execute if successful.
error: (Optional) The callback to execute if an error occurs.
// Exit
tagManager.exit();
The MIT License
Copyright (c) 2014 Jared Dickson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Google Tag Manager plugin for analytics tracking with support for events and pageviews.
The npm package tobostudio.cordova-plugin-tag-manager receives a total of 0 weekly downloads. As such, tobostudio.cordova-plugin-tag-manager popularity was classified as not popular.
We found that tobostudio.cordova-plugin-tag-manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.