Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 23e4124

Browse files
author
Jelle Klaver
committed
Inital commit
0 parents  commit 23e4124

11 files changed

+6979
-0
lines changed

.babelrc

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"env": {
2+
"development": {
3+
"presets": [
4+
[
5+
"@babel/env",
6+
{
7+
"modules": false
8+
}
9+
],
10+
"@babel/react"
11+
]
12+
},
13+
"test": {
14+
"presets": [
15+
"@babel/env",
16+
"@babel/react"
17+
]
18+
},
19+
"production": {
20+
"presets": [
21+
[
22+
"@babel/env",
23+
{
24+
"modules": false
25+
}
26+
],
27+
"@babel/react"
28+
],
29+
"plugins": [
30+
"@babel/plugin-transform-react-constant-elements",
31+
"@babel/plugin-transform-react-inline-elements"
32+
]
33+
}
34+
}

.eslintrc

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"mocha": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"airbnb"
10+
],
11+
"parser": "babel-eslint",
12+
"plugins": [
13+
"react"
14+
],
15+
"rules": {
16+
"no-console": 0,
17+
"max-len": 0,
18+
"strict": 0,
19+
"import/no-dynamic-require": 0,
20+
"import/newline-after-import": 0,
21+
"no-underscore-dangle": 0,
22+
"consistent-return": 0,
23+
"import/no-extraneous-dependencies": 0,
24+
"no-plusplus": 0,
25+
"no-useless-escape": 0,
26+
"react/jsx-filename-extension": 0,
27+
"react/forbid-prop-types": 0,
28+
"no-unneeded-ternary": 0,
29+
"class-methods-use-this": 0,
30+
"react/require-default-props": 0,
31+
"no-param-reassign": 0,
32+
"comma-dangle": 0
33+
}
34+
}

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# https://git-scm.com/docs/gitignore
2+
# https://help.github.com/articles/ignoring-files
3+
# Example .gitignore files: https://github.com/github/gitignore
4+
/bower_components/
5+
/node_modules/
6+
.DS_store
7+
.module-cache
8+
npm-debug.log
9+
.c9
10+
.vscode/

.npmignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.*.swp
2+
._*
3+
.DS_Store
4+
.git
5+
.hg
6+
.lock-wscript
7+
.svn
8+
.wafpickle-*
9+
CVS
10+
npm-debug.log
11+
node_modules/
12+
.DS_store
13+
.module-cache
14+
npm-debug.log
15+
.c9

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# react-linkedin-insight
2+
Easily add LinkedIn Insight Tag to React.
3+
It is heavily inspired by [react-facebook-pixel](https://github.com/zsajjad/react-facebook-pixel) from [@zsajjad](https://github.com/zsajjad).
4+
5+
## Install
6+
This repo is available via npm ([react-linkedin-insight](https://www.npmjs.com/package/@jelleklaver/react-linkedin-insight))
7+
8+
```bash
9+
npm install react-linkedin-insight --save
10+
```
11+
12+
## Usage
13+
Import, initialize and play. Too bad the LinkedIn Insight Tag does not have the abilities which the Facebook Pixel or Google Analytics have, but we can measure a page load and conversions.
14+
15+
```javascript
16+
import LinkedInTag from 'react-linkedin-insight';
17+
18+
LinkedInTag.init(partnerId);
19+
LinkedInTag.track(conversionId);
20+
```
21+
22+
### Partner ID
23+
You can get the partner ID from the script LinkedIn provides when you create an Insight Tag. The partner ID can be found on the second row of the code they provide: `_linkedin_partner_id = "123456";` where the 123456 is your partner ID.
24+
25+
### Conversion ID
26+
Conversions can only be tracked if they are created within the LinkedIn Campaign Manager. Once an event-specific pixel is created, they will provide an image tag like `<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=123456&conversionId=789012&fmt=gif" />`. The `789012` behind the `conversionId=` is your conversion ID.
27+
28+
### Tracking navigation with a client-side router
29+
Currently there is no option in automatically tracking navigation with client-side routing. Input would be very helpful and appreciated. It could be opted to create a conversion in LinkedIn which is called 'virtualPageView' or so, but I don't think this is good practice. We should create a way in which LinkedIn registers a navigation change as a page load.
30+
31+
## License (ISC)
32+
Copyright 2018 Jelle Klaver
33+
34+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
35+
36+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

dist/linkedin-insight.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/linkedin-insight.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)