This week's book giveaway is in the Go forum.
We're giving away four copies of Head First Go and have Jay McGavren on-line!
See this thread for details.
Win a copy of Head First Go this week in the Go forum!

Richard Wilde

Greenhorn
+ Follow
since Mar 14, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Richard Wilde

Hi Java Forum,

I have a massive problem... I want to send a php variable using java to my data layer and as an array. Please see below.... I have also attached an image to demonstrate the data layer. it all works but the category variable.

Thanks!


<script>
window.dataLayer.push({
'date': '<?php echo get_the_date(); ?>',
'authorID': '<?php the_author_meta( 'ID' ); ?>',
'postname': '<?php the_title(); ?>',
<?php $categories = get_the_category() ?>
'category': '<?php echo $categories;?>'
});
</script>
1 week ago