Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7569557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:11:45+00:00 2026-05-30T15:11:45+00:00

I am currently using SlideDeck and reporting the viewed slide number to be reported

  • 0

I am currently using SlideDeck and reporting the viewed slide number to be reported in Google Analytics. What I’m wondering (and honestly have no idea if possible) is whether if the slide deck API reports a specific number, I can assign a label/text to it?

The code I’m using is:

  $(document).ready(function() {
    $('#nextSlide').click(function() {
     $('.slidedeck').slidedeck().next({
        before: function(deck){
        // do nothing
        },
        complete: function(deck){
          var slideNumber = deck.current != null ? deck.current + ' - ' : '';
          _gaq.push(['_trackEvent', 'slidedeck', 'viewed slides', slideNumber + 'slide number']);
        }
      });
    });
  });

This successfully reports the following to Google Analytics:
‘slidedeck’ (category), ‘viewed slides’ (label), ‘1 – slide number’ (value, assuming slide 1 is being shown).

What I want to do is assign a name to the result 1, 2, 3 etc..

So in my head (and this is completely not the code as I have no clue how to approach this, but to demonstrate the kind of result:

   var slideNumber = deck.current != null ? deck.current + ' - ' : '';
      if($(this).val() == '1'){ //function to report code as '1 - title example'}
});
      if($(this).val() == '2'){ //function to report code as '2 - title example'}
});   

So the GA event tracking code would be:

_gaq.push(['_trackEvent', 'slidedeck', 'viewed slides', slideNumber + 'was viewed']);

which submits an Event with the following label, assuming slide 1 is viewed:

‘slidedeck’ (category), ‘viewed slides’ (label), ‘1 – title example – was viewed’

I appreciate I’m being vague, and asking a lot – but if anyone can even steer me in the right direction or point me to the functions I’d need to look into, that’d be awesome.

EDIT:

I’ve added this code to the script nnnnnn:

    $(document).ready(function() {
              var slideTitles = [ "Slide 0 title here",
                                  "Slide 1 title here",
                                  "Slide 2 title here"
                                ]; 
    $('#next').click(function() {
            $('.slidedeck').slidedeck().next({
        before: function(deck){
        // do nothing
        },
        complete: function(deck){
            var slideNumber = deck.current != null ? deck.current + ' - ' : ''; 
          _gaq.push(['_trackEvent', 'slidedeck', 'viewed slides', slideTitles[slideNumber] + 'was viewed']);
        }
      });

});

But I get the following Event Label in Google Analytics: ‘undefinedwas viewed’.

What I don’t get (as I’m new to jQuery!) is how the response from:

complete: function(deck){
          var slideNumber = deck.current != null ? deck.current + ' - ' : '';

binds to the array titles?

the deck.current is an API response from the slidedeck plugin, just giving the numeric value of the currently viewed slide.

Sorry to be a pain!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:11:46+00:00Added an answer on May 30, 2026 at 3:11 pm

    You can put the titles in an array where the array indexes are (obviously) the slide numbers:

    var slideTitles = [ "Slide 0 title here",
                        "Slide 1 title here",
                        "Slide 2 title here",
                        ... ];
    

    (If there’s no slide 0 just put an empty string as a placeholder so that the other indexes correspond to the right titles.)

    Then in your existing code given a slideNumber just say slideTitles[slideNumber] to get the corresponding title.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently using Google Analytics as a supplement to our paid tracking software, but neither
I am currently using mixpanel with the default 'mixpanel' gem for analytics and have
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
I am currently using Windows Server 2008 Standard and have several Hyper V machines.
I am currently using matplotlib.pyplot to create graphs and would like to have the
Currently using cocos2d. I have a plist data name myplist.plist. Inside the plist are
I am currently using Java to communicate with device through Serial communication. I have
Im currently using Spring 3.0.x .. Im wondering what's wrong with these structures, where
I am currently using federated authentication via openid in appengine - using google, yahoo,
am currently using google feed api to get feed links dynamically. am trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.