WordPress.org

Ready to get started?Download WordPress

Forums

WP Google Analytics Events
[resolved] WP Google Analytics Events Plug-in (Class vs. ID) (3 posts)

  1. dmgonzal
    Member
    Posted 5 months ago #

    Does anyone know the difference between "class" and "id" for Type when using the WP Google Analytics Events Plug-in. When would you use "class" over "id"?

    http://wordpress.org/plugins/wp-google-analytics-events/

  2. joelgoodman
    Member
    Posted 4 months ago #

    This has to do with HTML/CSS validation rules. And ID can apply to only one specific element on the page while you can group elements together with a class.

    So, say you had a list of links to PDFs on a resources page you wanted to track download events, you could apply a class of pdf-download to all of those links and this plugin would track the event on everything with that class. Otherwise you have to break down a separate ID for each link and manually enter them.

    This is a good explanation of the difference: http://css-tricks.com/the-difference-between-id-and-class/

  3. dmgonzal
    Member
    Posted 4 months ago #

    Hey Joel,

    Thanks so much for responding. This makes total sense now. The reference you provided does a great job of further explaining.

    High five & thanks!

Reply

You must log in to post.

About this Plugin

About this Topic