Code Monkey home page Code Monkey logo

openpixel's People

Contributors

boralp avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar eagleeye avatar ecmarsh avatar fjahn avatar guglielmobartelloni avatar hsynlms avatar rkanson avatar shurth avatar stuyam avatar tim-hanssen avatar xitude avatar yulianmoreno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openpixel's Issues

CORB problem in Chrome and in near time in Firefox too

I add a project in a website, but have a problem with CORB actually only in Chrome but in near time Firefox show information adding this control to.

https://www.chromestatus.com/feature/5629709824032768

You know how can i fix this in an openpixel code ?

Thanks in advance !

Luis

Video Tracking

Would be cool to track how long someone spent watching video(s) that are on displayed on the websites. Most popular targets could be youtube and vimeo. The idea would be to get data passed back similar to https://plugins.matomo.org/MediaAnalytics, just without the fancy interface.

async await and import

What changes are required to be able to use async await and import with openpixel?

Currently using async await and import throws an error when gulp is running.

Event variables question

HI! Please Ignore this, I was able to figure it out by doing

<button data-opix-event={{sku}} sku="example123">


Hi! Thanks for all this great work!

I've got my pixel up and running, and am now trying to pass some variables along with my on-click events.

Currently this is working:

<button data-opix-event="added-to-cart">

(I can see the correct event getting pinged back to my endpoint)

Now, If I want to do something like this - passing a variable called sku along with this custom event:

<button data-opix-event="added-to-cart" sku="example123">

Is this how I go about it?

I know this seems to be the suggestion:
opix('event', 'data-opix-event', {sku: '123'}),
then where do I place this line of code in the repo exactly? And how do I send an actual sku variable from the frontend html?

Really sorry if I'm misunderstanding how to pass these variables...am a beginner with all of this. Any clarity would be helpful !

3rd party websites

We offer radio advertising, and we are looking at ways to better respond to our clients based on feedback we have received.

I am wondering is it possible to track 3rd party websites (I would guess it is, based on each app/website gets an ID)

Just interested in knowing the limitations of this pixel

getting openpixel up and running

Hi guys. I am went through the "setup and customize" steps for my Gatsby personal website e.g. ran npm i openpixel but still is unclear about how the tracking actually happens besides just putting the code on a page where I want to do the collecting/tracking. Thank you.

Get Visitor Id

We started using the pixel to track also not logged-in visitors. But it would be very easy if there would be a function to get the ID generated by the Pixel. So we can use that in REST API calls too.

opix('getId') 
or
opix('getVisitorId') 

Cant install

npm i openpixel
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "openpixel" under a package
npm ERR! also called "openpixel". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR!     <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>

Any suggestions?

Use pixel.gif

Sorry to came here to ask it, but how can i get "/pixel.gif[parameters]"?
i tried use php and nodejs but i couldn't get de information, i just get when i change the file "pixel.gif" to "pixel.php".

Anyone here can help me?

Sending Event Data to DB

Thanks for open sourcing this. It's really a great project.

I had a question about how you implement. Where's the best place to send the tracking data to? Do you have it call an open rest api which stores the data to the DB?

If so, where would I call the api from?

Thanks again!

Pixel not tracking mobile device?

Hi!
I have the pixel installed and it's working as expected when i access my tracked site from my Mac laptop using Chrome browser.

When I try and access the same tracked url via my phone's chrome browser, my server isn't receiving any events.

Any ideas why it's not tracking any events from chrome/safari via my mobile devices?

// follow-up question:
is there a way to track the same user across multiple devices?

Thanks!

Tracking pageview in a SPA

I trying to add page tracking for a SPA (Angular) but can't seem to get it to work. I can get other events to work but not pageload. For example triggering the following event on a route change in my app doesn't send out the event, the only time is does work is on the first page load.

opix('event', 'pageload');

Errors once I run "npm run gulp"

It shows:
[14:24:46] Using gulpfile c:\Users\me\Dev\openpixel\gulpfile.js
[14:24:46] Starting 'default'...
[14:24:46] 'default' errored after 5.47 ms
[14:24:46] TypeError: gulp.start is not a function
at c:\Users\me\Dev\openpixel\gulpfile.js:82:8
at taskWrapper (c:\Users\me\Dev\openpixel\node_modules\undertaker\lib\set-task.js:13:15)
at bound (domain.js:402:14)
at runBound (domain.js:415:12)
at asyncRunner (c:\Users\me\Dev\openpixel\node_modules\async-done\index.js:55:18)
at process._tickCallback (internal/process/next_tick.js:61:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] gulp: gulp
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] gulp script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\me\AppData\Roaming\npm-cache_logs\2019-08-29T19_24_46_371Z-debug.log

2019-08-29T19_24_46_371Z-debug.log shows
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'gulp' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'pregulp', 'gulp', 'postgulp' ]
5 info lifecycle [email protected]pregulp: [email protected]
6 info lifecycle [email protected]
gulp: [email protected]
7 verbose lifecycle [email protected]gulp: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
gulp: PATH: C:\Program ...
9 verbose lifecycle [email protected]gulp: CWD: c:\Users\me\Dev\openpixel
10 silly lifecycle [email protected]
gulp: Args: [ '/d /s /c', 'gulp' ]
11 silly lifecycle [email protected]gulp: Returned: code: 1 signal: null
12 info lifecycle [email protected]
gulp: Failed to exec gulp script
13 verbose stack Error: [email protected] gulp: gulp
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd c:\Users\me\Dev\openpixel
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "gulp"
18 verbose node v10.16.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] gulp: gulp
22 error Exit status 1
23 error Failed at the [email protected] gulp script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

UTM Parameters Not Updating Correctly

I've encountered an issue where the UTM parameters stored in cookies do not always match the UTM parameters in the document location (dl param). Specifically, I often observe cases where the UTM parameter in the URL is different from the one stored in the cookies from a previous session.

For example:

Document Location URL: https://page.com/test?utm_creative_format=test
Stored UTM Cookie Value: old_test (value from a previous session)
Expected UTM Parameter (in the pixel request): utm_creative_format=test
Actual UTM Parameter (in the pixel request): utm_creative_format=old_test (value from a previous session)

Has anyone else experienced this problem?

Classify events separatly

Everything fine, Thanks for Pixel.

One thing i need to ask, Is there any easy way to make pixel work like
opix.track('event', 'reservation', {'key' : 'value'})
to track the events

and opix.user.setEmail('email', '[email protected]') to set or update user's profile data.

Means, If we have that sort of function it will be easy to call API on basis of function called.

Thanks

Guplify Error

Getting the following error when running 'npm run gulp'

internal/streams/legacy.js:57
      throw er; // Unhandled stream error in pipe.
      ^
GulpUglifyError: unable to minify JavaScript

This error does not occur when I comment out .pipe(uglify()) on lines 55 and 68 of gulpfile.js.

The problem is that when I comment that line out it doesn't minify and I'm a bit worried about performance.

Is there a fix for this?

READ ME Update

Howdy!

It seems that in your READ ME file, you specify the build command is:
npm run build

But in the package.json file, the command is listed as:
npm run gulp build

GET or POST request

Hello, I was testing the generated openpixel.js script and i saw something that i would like to undestand better.
The default behavior of an event is sending a POST request to the pixel URL (using navigator.sendBeacon), right?
I thought the request type would be always GET. Do i need to create 2 different endpoints in my backend for getting the pixel image (one that receives a POST request and one that receives a GET request)?
On the generated script, looks like if the navigator.sendBeacon function does not exist it would inject an img tag on the HTML, that would be a GET request. Should i be prepared for both scenarios?
Thanks!

cross domain tracking.

  • I am using this package to track visits, clicks in the domain A and its sub domain, for this i have done few customizations.
  • trying to see if this package can be used for cross domain tracking. ?

Any thoughts. ? really appreciated

Thanks.

onclick events

In setup.js it would be much better to use addEventListener rather than overriding the onclick event which leads to breaking most of the website you might put the pixel on.

Regards

query string encoding fails with semicolon in the user agent

The user agent string includes semicolons. For example: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0."

Formally these semicolons are illegal characters in a query string (see https://www.w3.org/TR/2014/REC-html5-20141028/forms.html#url-encoded-form-data).

This is why the results on my end look funny. Here the query string is parsed as follows (see first two keys)

{
  "ua": "Mozilla/5.0 (X11",
  " Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36": "",
  "bn": "Chrome 71",
  "cd": "24",
  "de": "windows-1252",
  "dl": "XXXX",
  "dt": "TESY",
  "ed": "",
  "ev": "pageclose",
  "id": "ID-XXXXXXXX",
  "md": "false",
  "rl": "",
  "sr": "1920x1080",
  "ts": "1550069975865",
  "uid": "HHHHHHH",
  "utm_campaign": "",
  "utm_content": "",
  "utm_medium": "",
  "utm_source": "",
  "utm_term": "",
  "v": "1",
  "vp": "1918x959"
}

Why does Openpixel send some data that might be unnecessary?

I just wanted to know why Openpixel sends the below information in events:

  1. Browser name
  2. Mobile device
  3. Timestamp in microseconds
  4. Timezone offset (minutes away from UTC)

The first two can be extracted from User-Agent by using some 3rd party tools like 51degrees.
This is the best and most accurate way (I think) to detect the browser and the device. Let the backend handle this data extraction. This will give people the flexibility to parse the User-Agent by using their own parser algorithm or by using a tool. This will also impact Openpixel performance, event URL length, and the distributable file size in a positive manner.

The third one can also be calculated on the server-side when the event request has arrived.

For the last one, my suggestion is to detect the timezone from the visitor's IP address. There are several tools for that such as ipstack. No need to send it to the request URL?

Here are some good catches for JavaScript getTimezoneOffset method and its accuracy:
https://stackoverflow.com/questions/13/determine-a-users-timezone#comment38955981_1809974
https://stackoverflow.com/questions/13/determine-a-users-timezone#comment34982097_1809974

As I said in the beginning I am curious and just wanted to know the reasons behind it, all my opinions are open to discussion.

Implementing Openpixel

I'm pretty new at tracking pixels, so I thought this was a good place to start to track users on my website. I've followed the "setup and customize" instructions to get the dist file with the Snippet and Core code. I've been trying to figure out how to integrate the code into my website to actually start getting data. Unfortunately, the README doesn't specify any of these instructions.

Can some of these instructions be added? I've been trying to implement it in websites using no frameworks, using VueJS, and using ReactJS. Any help would be appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.