Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDASILVA committed Mar 1, 2019
2 parents 893419b + 92c03f2 commit 124104f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ The tracking pixel instance is available on all vue component instances as $fb.
|-------------------|----------------------------------------------------------------------------------------------------------|--------------------------------|
| enable() | If you had previously set `disabled: true` in config, enables the pixel and tracks the current page view | $fb.init(), $fb.track() |
| init() | Initialises the pixel | fbq('init', <options.pixelId>) |
| track() | Sends a track event | fbq('track', <options.track>) |
| query(key, value) | Call the underlying fbq instance with anything else | fbq(key, value) |
| track(event) | Sends a track event. It's `PageView` by default if the `event` is not defined. | fbq('track', <options.track>) |
| query(key, value, parameters) | Call the underlying fbq instance with anything else. The `parameters` attribute is optional. | fbq(key, value, parameters) |

## License

Expand Down
13 changes: 9 additions & 4 deletions lib/templates/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,26 @@ class Fb {
/**
* @method track
*/
track (event = null) {
track (event = null, parameters = null) {
if (!event) {
event = this.options.track
}

this.query('track', event)
this.query('track', event, parameters)
}

/**
* @method query
* @param {string} cmd
* @param {object} option
* @param {object} parameters
*/
query (cmd, option) {
this.fbq(cmd, option)
query (cmd, option, parameters = null) {
if (!parameters) {
this.fbq(cmd, option)
} else {
this.fbq(cmd, option, parameters)
}
}
}

Expand Down

0 comments on commit 124104f

Please sign in to comment.