Giter Club home page Giter Club logo

Comments (6)

bittner avatar bittner commented on June 12, 2024

Sounds like a good idea!

If you feel that #142 is not good enough of a PR do you want to try and open an alternative one as a contribution?

from django-analytical.

SilverStrings024 avatar SilverStrings024 commented on June 12, 2024

Sounds like a good idea!
If you feel that #142 is not good enough of a PR do you want to try and open an alternative one as a contribution?

I probably should have looked at the PRs huh? lol my apologies.
but, I'll take a look at the current code and see if there's anything I can come up with improvement wise.

Edit: After looking at the PR from 2019 I might have an idea for easier updating in the future as well as an idea to let users push things that aren't in the package (like enableHeartbeatTimer) but that needs more working out. I'll clone it, code it up and run some tests. If everything works out, I'll submit a PR

Edit 2: I made it so we don't need to add any hardcoded things like enableHeartbeatTimer in future updates. So now we can call
utils.build_paq_cmd('enableHeartbeatTimer') which returns a paq command like this
_paq.push(['enableHeartbeatTimer']) that we can use in the template tags. Note that this function accepts arguments and can likely be used to build events to be pushed to _paq on element click.

Since an event needs to be bound to the consent button, do you care if I make it so we can let users bind events dynamically? So people could make a loop that binds certain events to certain things in their own template tags. That could even make it so you can conditionally track your users.

So, after making that, if someone wanted to make Matomo track a button but wanted to do it with python, they could do this

analytical.utils.bind_event_js(matomo_event="contentInteraction", class_name="someCoolButton", args=['coolCategory', 'coolName'])
which will bind an element to an onClick event whose handler pushes the command that build_paq_cmd() spat out to _paq

So when the user clicks on the button with the class name 'someCoolButton' a contentInteraction event is pushed to _paq with the params we got in the call to bind_event()

from django-analytical.

SilverStrings024 avatar SilverStrings024 commented on June 12, 2024

@bittner I finished the PR but git was saying I wasn't allowed to push from my command line so I just uploaded the PR in files.

from django-analytical.

bittner avatar bittner commented on June 12, 2024

You need create your own fork of this repository, push the changes to your own fork (that will work) and place a PR from there.

from django-analytical.

SilverStrings024 avatar SilverStrings024 commented on June 12, 2024

You need create your own fork of this repository, push the changes to your own fork (that will work) and place a PR from there.

OOOOOOH sigh wow. Alright, thank you. I came up with a much better solution. Once I get this working, I'll be pushing

from django-analytical.

SilverStrings024 avatar SilverStrings024 commented on June 12, 2024

PR #193 Takes care of this

from django-analytical.

Related Issues (20)

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.